diff options
author | Guillaume Cottenceau <gc@mandriva.com> | 2001-06-11 11:44:34 +0000 |
---|---|---|
committer | Guillaume Cottenceau <gc@mandriva.com> | 2001-06-11 11:44:34 +0000 |
commit | ab5559aaabd1167a18ac882e64d97c5adc0e7d03 (patch) | |
tree | d22adafe4701e0abbccc7456fc58ae60ce75d5fb /mdk-stage1/ppp/scripts/ppp-off | |
parent | f35f2383eed07ff16aa76f30975817117eea6cbb (diff) | |
download | drakx-backup-do-not-use-ab5559aaabd1167a18ac882e64d97c5adc0e7d03.tar drakx-backup-do-not-use-ab5559aaabd1167a18ac882e64d97c5adc0e7d03.tar.gz drakx-backup-do-not-use-ab5559aaabd1167a18ac882e64d97c5adc0e7d03.tar.bz2 drakx-backup-do-not-use-ab5559aaabd1167a18ac882e64d97c5adc0e7d03.tar.xz drakx-backup-do-not-use-ab5559aaabd1167a18ac882e64d97c5adc0e7d03.zip |
Initial revision
Diffstat (limited to 'mdk-stage1/ppp/scripts/ppp-off')
-rwxr-xr-x | mdk-stage1/ppp/scripts/ppp-off | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/mdk-stage1/ppp/scripts/ppp-off b/mdk-stage1/ppp/scripts/ppp-off new file mode 100755 index 000000000..a22b5ea3d --- /dev/null +++ b/mdk-stage1/ppp/scripts/ppp-off @@ -0,0 +1,34 @@ +#!/bin/sh +###################################################################### +# +# Determine the device to be terminated. +# +if [ "$1" = "" ]; then + DEVICE=ppp0 +else + DEVICE=$1 +fi + +###################################################################### +# +# If the ppp0 pid file is present then the program is running. Stop it. +if [ -r /var/run/$DEVICE.pid ]; then + kill -INT `cat /var/run/$DEVICE.pid` +# +# If the kill did not work then there is no process running for this +# pid. It may also mean that the lock file will be left. You may wish +# to delete the lock file at the same time. + if [ ! "$?" = "0" ]; then + rm -f /var/run/$DEVICE.pid + echo "ERROR: Removed stale pid file" + exit 1 + fi +# +# Success. Let pppd clean up its own junk. + echo "PPP link to $DEVICE terminated." + exit 0 +fi +# +# The ppp process is not running for ppp0 +echo "ERROR: PPP link is not active on $DEVICE" +exit 1 |