summaryrefslogtreecommitdiff
path: root/scripts/ppp-off
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>1998-03-26 03:02:38 +0000
committerPaul Mackerras <paulus@samba.org>1998-03-26 03:02:38 +0000
commit0986fac0d4b42ade44f889ccc107b3ba5af58c5a (patch)
tree42f675b9b1ed4a112013073030603e24bd88fd2a /scripts/ppp-off
parentbc665e2d682d4318b607dc7e7c46b8b3f6273bf2 (diff)
downloadppp-0986fac0d4b42ade44f889ccc107b3ba5af58c5a.tar.gz
*** empty log message ***
Diffstat (limited to 'scripts/ppp-off')
-rwxr-xr-xscripts/ppp-off34
1 files changed, 34 insertions, 0 deletions
diff --git a/scripts/ppp-off b/scripts/ppp-off
new file mode 100755
index 0000000..a22b5ea
--- /dev/null
+++ b/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