1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
#!/bin/csh
if ("$1" == "up") then
echo "Bringing net up"
/usr/sbin/pppd connect '/usr/sbin/chat -v ABORT BUSY ABORT "NO CARRIER" "" ATZ OK ATS71=1 OK ATS80=1 OK ATDT4828060 CONNECT ""' /dev/cua0 115200 name halebopp remotename whitehole debug crtscts modem defaultroute 10.0.0.111:10.0.0.116
# Wait for connection success
set timer = 8
while ($timer > 0)
if (-e "/var/run/ppp0.pid") exit 0
sleep 1
@ timer = $timer - 1
end
echo "Couldn't get it up!"
exit -1
endif
if ("$1" == "down") then
echo "Bringing net down"
if (! -e "/var/run/ppp0.pid") exit 0
set pid = `cat /var/run/ppp0.pid`
kill $pid
exit 0
endif
echo "Usage: pppscript up down"
exit 1
|