Hi,
I have connected to my ISP via ONE SINGLE script ever since
I'm providing my script as well as the relevant portion of
my /var/log/messages file:
#!/bin/sh
user=MyUserID pass=MyPassword tel=1234567
T1=5 T2=25
exec pppd /dev/ttyS2 \
57600 \
crtscts \
defaultroute \
lock \
modem \
-detach \
noipdefault \
user $user \
connect \
"chat -v \
ABORT 'NO CARRIER' \
ABORT 'NO DIALTONE' \
ABORT BUSY \
TIMEOUT $T1 \
'' ATZL3M2 \
OK AT%TCBDT$tel \
TIMEOUT $T2 \
REPORT 'Waiting for connect ($T2 sec)\n' \
CONNECT \c \
'name>' '$user' \
'word>' '$pass' \
REPORT '* Login ok\n'" \
2>/y &
Depending on your version of pppd and chat several options or strings
may have slightly different names. For example, older versions of chat
used SAY instead of REPORT.
The last line performs redirection of stderr to my alternate
(Hercules) monitor. change it to your needs. Don't ommit the single
quotes around expect and send strings or the script won't work. If you
want more debugging output you can supply additional pppd options:
debug
kdebug 7 (may also be any other
binary combination of 1,2,4)
The substring %TCB in the middle of the dial string avoids the german
telekom caused redial lock and is modem specific. You should remove it.
Below comes my messages file:
Oct 4 23:40:17 chaos1 pppd[506]: pppd 2.3.5 started by root, uid 0
Oct 4 23:40:18 chaos1 chat[509]: abort on (NO CARRIER)
Oct 4 23:40:18 chaos1 chat[509]: abort on (NO DIALTONE)
Oct 4 23:40:18 chaos1 chat[509]: abort on (BUSY)
Oct 4 23:40:18 chaos1 chat[509]: timeout set to 5 seconds
Oct 4 23:40:18 chaos1 chat[509]: send (ATZL3M2^M)
Oct 4 23:40:18 chaos1 chat[509]: expect (OK)
Oct 4 23:40:19 chaos1 chat[509]: ATZL3M2^M^M
Oct 4 23:40:19 chaos1 chat[509]: OK
Oct 4 23:40:19 chaos1 chat[509]: -- got it
Oct 4 23:40:19 chaos1 chat[509]: send (AT%TCBDT1234567^M)
Oct 4 23:40:19 chaos1 chat[509]: timeout set to 25 seconds
Oct 4 23:40:19 chaos1 chat[509]: report (Waiting for connect (25
sec)\n)
Oct 4 23:40:19 chaos1 chat[509]: expect (CONNECT)
Oct 4 23:40:19 chaos1 chat[509]: ^M
Oct 4 23:40:42 chaos1 chat[509]: AT%TCBDT1234567^M^M
Oct 4 23:40:42 chaos1 chat[509]: CONNECT
Oct 4 23:40:42 chaos1 chat[509]: -- got it
Oct 4 23:40:42 chaos1 chat[509]: send (c^M)
Oct 4 23:40:42 chaos1 chat[509]: expect (name>)
Oct 4 23:40:42 chaos1 chat[509]: 57600^M
Oct 4 23:40:48 chaos1 chat[509]: ^M
Oct 4 23:40:48 chaos1 chat[509]:
Oct 4 23:40:48 chaos1 chat[509]: NDH Netzwerkdienste Hoeger GmbH^M
Oct 4 23:40:48 chaos1 chat[509]: ^M
Oct 4 23:40:48 chaos1 chat[509]: ^M
Oct 4 23:40:48 chaos1 chat[509]: Enter Username>
Oct 4 23:40:48 chaos1 chat[509]: -- got it
Oct 4 23:40:48 chaos1 chat[509]: send (MyUserID^M)
Oct 4 23:40:48 chaos1 chat[509]: expect (word>)
Oct 4 23:40:48 chaos1 chat[509]: MyUserID^M
Oct 4 23:40:48 chaos1 chat[509]: Enter User Password>
Oct 4 23:40:48 chaos1 chat[509]: -- got it
Oct 4 23:40:48 chaos1 chat[509]: send (MyPassword^M)
Oct 4 23:40:48 chaos1 pppd[506]: Serial connection established.
Oct 4 23:40:48 chaos1 chat[509]: report (* Login ok\n)
Oct 4 23:40:49 chaos1 pppd[506]: Using interface ppp0
Oct 4 23:40:49 chaos1 pppd[506]: Connect: ppp0 <--> /dev/ttyS2
Oct 4 23:40:50 chaos1 pppd[506]: local IP address 195.94.95.207
Oct 4 23:40:50 chaos1 pppd[506]: remote IP address 195.94.95.5