aboutsummaryrefslogtreecommitdiffstats
path: root/ppp/ppp-2.4.1/poff
diff options
context:
space:
mode:
Diffstat (limited to 'ppp/ppp-2.4.1/poff')
-rw-r--r--ppp/ppp-2.4.1/poff26
1 files changed, 26 insertions, 0 deletions
diff --git a/ppp/ppp-2.4.1/poff b/ppp/ppp-2.4.1/poff
index e69de29bb2..0521a9406a 100644
--- a/ppp/ppp-2.4.1/poff
+++ b/ppp/ppp-2.4.1/poff
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# Lets see how many pppds are running....
+set -- `cat /var/run/ppp*.pid 2>/dev/null`
+
+case $# in
+ 0) # pppd only creates a pid file once ppp is up, so let's try killing pppd
+ # on the assumption that we've not got that far yet.
+ killall pppd
+ ;;
+ 1) # If only one was running then it can be killed (apparently killall
+ # caused problems for some, so lets try killing the pid from the file)
+ kill $1
+ ;;
+ *) # More than one! Aieehh.. Dont know which one to kill.
+ echo "More than one pppd running. None stopped"
+ exit 1
+ ;;
+esac
+
+if [ -r /var/run/ppp-quick ]
+then
+ rm -f /var/run/ppp-quick
+fi
+
+exit 0