home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OpenStep 4.2
/
Openstep-4.2-Intel-User.iso
/
usr
/
template
/
client
/
etc
/
ppp
/
Examples
/
ip-down-part2
< prev
next >
Wrap
Text File
|
1995-11-06
|
1KB
|
49 lines
#!/bin/sh
#
# This script does the real work of the ip-down processing. It will
# cause the system to terminate just to make sure that everything is
# dead; restart the ppp-on script processing to re-dial the sequence.
#
NETDEVICE=$1
TTYDEVICE=`basename $2`
SPEED=$3
LOCAL_IP=$4
REMOTE_IP=$5
#
# If the process is still running, then try to terminate the process
#
if [ -r /etc/ppp/$NETDEVICE.pid ]; then
echo '' >>/etc/ppp/$NETDEVICE.pid
pid = `head -1 /etc/ppp/$NETDEVICE.pid`
if [! "$pid" = "" ]; then
sleep 5s
kill -HUP $pid
if [ "$?" = "0" ]; then
sleep 5s
KILL -TERM $pid
if [ "$?" = "0" ]; then
sleep 5s
fi
fi
fi
#
# Ensure that there is no junk left in the system
#
rm -f /etc/ppp/$NETDEVICE.pid
rm -f /usr/spool/uucp/LCK/LCK..$TTYDEVICE
fi
#
# Since the defaultroute will not be added if there is an existing default
# route, remove it now. Do not do this if the defaultroute route was not
# added by the ppp script.
#
# route del default
#
# Finally, restart the connection sequence.
#
exec /etc/ppp/ppp-on