aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/ifdown-ppp
diff options
context:
space:
mode:
authorNalin Dahyabhai <nalin@redhat.com>2000-08-07 09:09:04 +0000
committerNalin Dahyabhai <nalin@redhat.com>2000-08-07 09:09:04 +0000
commita2989f6b0eb119c60088dc2c6be720601c8542a1 (patch)
treec7b9ce9d5fd8f23c58ec0aaed0c05edbb8813fe7 /sysconfig/network-scripts/ifdown-ppp
parentbffc09ca0f9081340e51a3b8de865f549ae93c2c (diff)
downloadinitscripts-a2989f6b0eb119c60088dc2c6be720601c8542a1.tar
initscripts-a2989f6b0eb119c60088dc2c6be720601c8542a1.tar.gz
initscripts-a2989f6b0eb119c60088dc2c6be720601c8542a1.tar.bz2
initscripts-a2989f6b0eb119c60088dc2c6be720601c8542a1.tar.xz
initscripts-a2989f6b0eb119c60088dc2c6be720601c8542a1.zip
fix demand-dialing for PPP
Diffstat (limited to 'sysconfig/network-scripts/ifdown-ppp')
-rwxr-xr-xsysconfig/network-scripts/ifdown-ppp25
1 files changed, 18 insertions, 7 deletions
diff --git a/sysconfig/network-scripts/ifdown-ppp b/sysconfig/network-scripts/ifdown-ppp
index 3265c72d..282c22b0 100755
--- a/sysconfig/network-scripts/ifdown-ppp
+++ b/sysconfig/network-scripts/ifdown-ppp
@@ -7,7 +7,18 @@ cd /etc/sysconfig/network-scripts
CONFIG=$1
source_config
-file=/var/run/pppwatch-$DEVICE.pid
+if [ "${DEMAND}" != no -a -f /var/run/ppp-${DEVICE}.pid ] ; then
+ PID=`head -1 /var/run/ppp-${DEVICE}.pid`
+ kill -TERM ${PID}
+ sleep 2
+ [ ! -d /proc/${PID} ] && exit 0
+ kill -TERM ${PID}
+ sleep 2
+ [ ! -d /proc/${PID} ] && exit 0
+ exit 1
+fi
+
+file=/var/run/pppwatch-${DEVICE}.pid
if [ ! -f $file ]; then
# ppp isn't running, or we didn't start it
@@ -15,17 +26,17 @@ if [ ! -f $file ]; then
fi
PID=`cat $file`
-[ -n "$PID" ] || exit 1
+[ -n "${PID}" ] || exit 1
-kill -TERM $PID > /dev/null 2>&1
-[ ! -d /proc/$PID ] && exit 0
+kill -TERM ${PID} > /dev/null 2>&1
+[ ! -d /proc/${PID} ] && exit 0
sleep 2
-[ ! -d /proc/$PID ] && exit 0
+[ ! -d /proc/${PID} ] && exit 0
# killing ppp-watch twice in a row causes it to send a SIGKILL to pppd pgrp
-kill -TERM $PID > /dev/null 2>&1
+kill -TERM ${PID} > /dev/null 2>&1
# ip-down won't run in this case
/etc/sysconfig/network-scripts/ifdown-post $1
-[ ! -d /proc/$PID ] && exit 0
+[ ! -d /proc/${PID} ] && exit 0
exit 1