On 28 Apr 98 at 20:21, [EMAIL PROTECTED] wrote:

> I'm wondering how I would go about writing a script using the
> network config that would allow me to login in to my ISP that uses a
> menu.

Can't help you specifically with using netcfg as I don't have X 
installed here.  I _can_ tell you pretty much what you'll need in 
your script though.  The script is stored in 

/etc/sysconfig/network-scripts/chat-ppp0

so you'll be able to find it there...

I am guessing that netcfg lets you enter a series of expect/response 
pairs.  You basically want to create something that will cope with 
your login.  My ppp login consists of a connection, then asking for 
my username, password and then prompting me for a choice (where I 
enter ppp to start my ppp connection).  As an added twist my ISP then 
does a CHAP authentication on the connection but I won't deal with 
that side of things unless you need it too.

My chat-ppp0 looks like this:

-----8<-----
'TIMEOUT'       '10'
'ABORT'         'BUSY'
'ABORT'         'ERROR'
'ABORT'         'NO CARRIER'
'ABORT'         'NO ANSWER'
'ABORT'         'Invalid Login'
'ABORT'         'Login Incorrect'
'ABORT'         '/nRINGING/r/n/r/nRINGING/r'
''              '/rAT'
'OK-+++/c-OK'   'ATH0'
'TIMEOUT'       '90'
'OK'            'ATDT555 5555'
'CONNECT'       '/c'
'erification'   '/d/c'
'rname--rname'  'userid'
'sword'         'userpass'
'hoice'         'ppp'
-----8<-----

You may not need all of the 'ABORT' lines - it depends on situations 
you want to deal with.  I might add that this script was originally 
on a slackware box and some of it may not be totally relevant to RH5 
although it certainly works under RH5.

The stuff you're really looking for in the scripted loging basically 
starts with the 'atdt 555 5555' bit.  After you dial you're waiting 
for a 'CONNECT'.  Then you're waiting for some sort of message to 
tell you you're starting user verification.  In my case I just hang 
around waiting to see 'erification' (just in case the capitalise the 
'V').  Once I get that I then wait for 'rname' (it's actually 
Username but once again they might change capitalisations and stuff). 
The added bit here is doing 'rname--rname' which basically means wait 
a while for 'rname' and if you don't see it send a carriage return 
and wait some more for 'rname'.  It gets you around the problem of 
missing the username prompt.  After that wait for 'sword' (i.e. 
password) and send your password thru.  Then you'd be waiting for the 
prompt that asks you what to do.  You'd have to look for an 
appropriate word here but in my case it's 'Choice' which I simplify 
to 'hoice'.  When the chat script sees that it sends thru the command 
needed to start ppp - in my case that's 'ppp' but in your case you'd 
send '2'.

Hope this is of help...  <g>

Cheers, Dave.

-------------------------------------------------------------------------
Dave Freeman               System Administrator      Outback Qld Internet
Longreach                   Outback Queensland                  Australia
mailto:[EMAIL PROTECTED]            http://www.longreach.net.au/
Member                  Int Webmasters Association     http://iwanet.org/
-------------------------------------------------------------------------


-- 
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com/RedHat-FAQ /RedHat-Errata /RedHat-Tips /mailing-lists
         To unsubscribe: mail [EMAIL PROTECTED] with 
                       "unsubscribe" as the Subject.

Reply via email to