2 # Script for multiple redialing to bring up PPP connection.
3 # Written by Colin.Allen@tamu.edu
4 # I make no warranties about this script, but if you have suggestions
5 # for improving it please feel free to email them to me.
7 # Last modified 11-29-95
9 if ( -f /usr/local/ppp/etc/ppp0.pid ) then
11 # The ppp0.pid file should only exist with an active ppp connection
12 # in which case we don't want to try to dial out. Sometimes the file
13 # will need to be deleted manually if ppp was dropped abnormally.
15 echo ERROR: PPP already running.
27 # Next we loop as long as we are not quitting. Each circuit we check
28 # for a connection and if it's there we launch PopOver.
29 # Delete or add other programs as desired.
31 if ( -f /usr/local/ppp/etc/ppp0.pid ) then
33 echo Connected after $count attempts.
34 echo -n "Launching PopOver...Process id: "
35 nohup /LocalApps/PopOver.app/PopOver &
38 # If the connection is not there we ascertain whether the modem is
39 # still trying to get a connection by looking to see if "chat" appears
40 # in the output of ps. It is bound to appear at least once because ps
41 # will find the grep process. If it appears exactly once then any
42 # previous connection attempt has failed and we need to allow time
43 # for the modem to reset, then we are free to dial again.
45 # You may be able to optimize this script by adjusting the sleep values
46 # below. My modem (a ZyXEL 1496E) takes about 8 seconds to reset after
50 set chat = `ps | grep -c chat`
51 if ( $chat == 1 ) then
52 if ( $count != 0 ) then
57 if ( $count == $limit ) then
58 echo "Dial count over limit. Aborting."
61 /usr/local/ppp/scripts/$script
62 echo -n "($count) Dialing..."
64 echo -n "trying to connect..."
69 # If chat is still working we just wait a bit and loop again.