login with multiple prompts
I am facing a problem from my ISP ( [url]www.sancharnet.in[/url] ). They sent
different login prompts ( login: , Username:) etc every time I dial up.
How do you deal with this from Chat ? ( ': user' is little trucky I guess)
Also is it possible to change the timeout values inside the chat script ?
Like 10 sec. for first operation, 60 seconds for second operation etc. ?
Thanks,
George
Re: login with multiple prompts
geoerge <georgevarughese@indiatimes.com> wrote:[color=blue]
> I am facing a problem from my ISP ( [url]www.sancharnet.in[/url] ). They sent
> different login prompts ( login: , Username:) etc every time I dial up.
> How do you deal with this from Chat ? ( ': user' is little trucky I guess)[/color]
This is a variation of an example from man chat:
ogin:-BREAK-name: ppp ssword: hello2u2
It should be good except for etc, except you would want to set the
chat time to a low value (5 seconds?) just before login: or Username:
is expected. Simply using ":" as the expect in the expect/send might
also work.
[color=blue]
> Also is it possible to change the timeout values inside the chat script ?
> Like 10 sec. for first operation, 60 seconds for second operation etc. ?[/color]
Yes. Read man chat.
-- Clifford Kite Email: "echo [email]xvgr_yvahk-ccc@ri1.arg[/email]|rot13"
PPP-Q&A links, downloads: [url]http://ckite.no-ip.net/[/url]
/* "PPPoE has many advantages for DSL service providers, and
practically none for DSL consumers."
- David F. Skoll */
Re: login with multiple prompts
Clifford Kite <kite@see.signature.id> writes:[color=blue]
> This is a variation of an example from man chat:
>
> ogin:-BREAK-name: ppp ssword: hello2u2[/color]
You might not want to send BREAK there. Try "-\c-" instead.
In any event, there's nothing magical about the "chat" program. Any
program that can use standard I/O can function as a "connect" script
for pppd. For complicated things, something more powerful, such as
Perl, might be a good choice.
--
James Carlson, IP Systems Group <james.d.carlson@sun.com>
Sun Microsystems / 1 Network Drive 71.234W Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757 42.497N Fax +1 781 442 1677
Re: login with multiple prompts
[email]georgevarughese@indiatimes.com[/email] (geoerge) writes:
]I am facing a problem from my ISP ( [url]www.sancharnet.in[/url] ). They sent
]different login prompts ( login: , Username:) etc every time I dial up.
]How do you deal with this from Chat ? ( ': user' is little trucky I guess)
The probability is reasonable that you should not log in anyway. You should
use waht mgetty calls AutoPPP. It, right after the CONNECT message you
should start ppp negotiations.
See [url]www.theory.physics.ubc.ca/ppp-linux.html[/url]
]Also is it possible to change the timeout values inside the chat script ?
]Like 10 sec. for first operation, 60 seconds for second operation etc. ?
sure. Just put the TIMEOUT <numbsec>
expect response pair anywhere you want.
It will apply until another one changes it.
TIMEOUT 300
'' AT
TIMEOUT 1
OK ATDT5551234
TIMEOUT 37
CONNECT '\d\c'
]Thanks,
]George
Re: login with multiple prompts
James Carlson <james.d.carlson@sun.com> wrote in message news:<xoavy8macdxj.fsf@sun.com>...[color=blue]
> Clifford Kite <kite@see.signature.id> writes:[color=green]
> > This is a variation of an example from man chat:
> >
> > ogin:-BREAK-name: ppp ssword: hello2u2[/color]
>
> You might not want to send BREAK there. Try "-\c-" instead.
>
> In any event, there's nothing magical about the "chat" program. Any
> program that can use standard I/O can function as a "connect" script
> for pppd. For complicated things, something more powerful, such as
> Perl, might be a good choice.[/color]
My understanding is that login:-\c-name: works as follows:
If timeout occurs wating for login:, then a \c is sent and waiting
starts for name:
Question is that if the string I get after the \c is login: won't
I miss the chance to login. ( Sad thing about this part of the world
is that the local calls are not free, unlike in US etc.) My isp has
become very unreliable in the past one year and sometimes it takes ages
to get any response to the chat script after the modem connects - lots of
times with no response! Meaning the provider is making money either way :-)
So the answer will be to use perl or so here us a regexp for the logwait.
BTW does anybody have a perl script example for doing the chat stuff ?
(Just a simple one will be helpful, no regexp etc. )
May be future versions of chat should support these kind of stuff.
Re: login with multiple prompts
geoerge <georgevarughese@indiatimes.com> wrote:
[color=blue]
> My understanding is that login:-\c-name: works as follows:
> If timeout occurs wating for login:, then a \c is sent and waiting
> starts for name:
> Question is that if the string I get after the \c is login: won't
> I miss the chance to login. ( Sad thing about this part of the world
> is that the local calls are not free, unlike in US etc.) My isp has
> become very unreliable in the past one year and sometimes it takes ages
> to get any response to the chat script after the modem connects - lots of
> times with no response! Meaning the provider is making money either way :-)[/color]
Unless you are *sure* the ISP requires login/password authentication
you could try configuring for PAP/CHAP authentication and see whether
that works. Check Bill Unruh's site for how to configure pppd to use
PAP/CHAP.
A mix of hosts that are able to do both login/password and PAP or CHAP
authentication with hosts that can only do PAP or CHAP authentication
could explain the times there is no response (prompt) at all. If only
login/password is allowed then the ISP is likely just plain greedy.
--
Clifford Kite Email: "echo [email]xvgr_yvahk-ccc@ri1.arg[/email]|rot13"
PPP-Q&A links, downloads: [url]http://ckite.no-ip.net/[/url]
Re: login with multiple prompts
[email]georgevarughese@indiatimes.com[/email] (geoerge) writes:
]James Carlson <james.d.carlson@sun.com> wrote in message news:<xoavy8macdxj.fsf@sun.com>...
]> Clifford Kite <kite@see.signature.id> writes:
]> > This is a variation of an example from man chat:
]> >
]> > ogin:-BREAK-name: ppp ssword: hello2u2
]>
]> You might not want to send BREAK there. Try "-\c-" instead.
]>
]> In any event, there's nothing magical about the "chat" program. Any
]> program that can use standard I/O can function as a "connect" script
]> for pppd. For complicated things, something more powerful, such as
]> Perl, might be a good choice.
]My understanding is that login:-\c-name: works as follows:
] If timeout occurs wating for login:, then a \c is sent and waiting
]starts for name:
]Question is that if the string I get after the \c is login: won't
Yes, it will not recognize ogin:
However again, are you sure that your ISP demands such a scripted login.
From the looks of it-- their not being consistant across their servers,
etc, I doubt very very much that your ISP wants you to log in.
Try ending your script with
CONNECT '\d\c'
Ie, no login, no nothing after CONNECT and see if that works. This is
called AutoPPP and almost all ISPs are set up this way. They may allow
login, but this is far better.
]I miss the chance to login. ( Sad thing about this part of the world
]is that the local calls are not free, unlike in US etc.) My isp has
]become very unreliable in the past one year and sometimes it takes ages
]to get any response to the chat script after the modem connects - lots of
]times with no response! Meaning the provider is making money either way :-)
Again this sounds like a provider who primarily provides AutoPPP and not
login. Try it. Really-- most ISPs do NOT use a login script. This would force
Windows users as well to use a script and ISPs do not trust Windows users
to get it right, and do not want to be deluged with phone calls. You are
like someone asking whether a pontoon or a rope bridge across a river is best,
ignoring the steel bridge already built just downriver.
]So the answer will be to use perl or so here us a regexp for the logwait.
]BTW does anybody have a perl script example for doing the chat stuff ?
](Just a simple one will be helpful, no regexp etc. )
]May be future versions of chat should support these kind of stuff.