aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/ifdown-ppp
diff options
context:
space:
mode:
authorMichael K. Johnson <johnsonm@redhat.com>1997-09-16 18:27:40 +0000
committerMichael K. Johnson <johnsonm@redhat.com>1997-09-16 18:27:40 +0000
commit15bb4512255d2790567231b99c54a45a98644d71 (patch)
tree0fc378da6900ed36a9eee114fec532add4fa4e85 /sysconfig/network-scripts/ifdown-ppp
parent9d4ab932f93b7193ea86f230aae060b5b68f0308 (diff)
downloadinitscripts-15bb4512255d2790567231b99c54a45a98644d71.tar
initscripts-15bb4512255d2790567231b99c54a45a98644d71.tar.gz
initscripts-15bb4512255d2790567231b99c54a45a98644d71.tar.bz2
initscripts-15bb4512255d2790567231b99c54a45a98644d71.tar.xz
initscripts-15bb4512255d2790567231b99c54a45a98644d71.zip
ifup and ifdown complain if $1 not specified.
The "ifcfg-" part of the device name is now optional for ifup and ifdown. ifdown-ppp kills a pppd's chat session if it is active. Generic part of ifup uses MACADDR variable if present. ifup-ppp honors DEBUG variable, both for pppd (debug) and chat (-v).
Diffstat (limited to 'sysconfig/network-scripts/ifdown-ppp')
-rwxr-xr-xsysconfig/network-scripts/ifdown-ppp6
1 files changed, 6 insertions, 0 deletions
diff --git a/sysconfig/network-scripts/ifdown-ppp b/sysconfig/network-scripts/ifdown-ppp
index 31845640..84325ca6 100755
--- a/sysconfig/network-scripts/ifdown-ppp
+++ b/sysconfig/network-scripts/ifdown-ppp
@@ -23,7 +23,13 @@ if [ -z "$PID" ]; then
exit 1
fi
+# pppd might have chat as a child; remember chat's pid to kill after pppd.
+# (After, not before, so that pppd doesn't just restart it).
+
+CHATPID=`ps aul | awk '$4 ~ $PID {print $3}' 2>/dev/null`
+
kill $PID > /dev/null 2>&1
+[ -n "$CHATPID" ] && kill $CHATPID > /dev/null 2>&1
if [ ! -d /proc/$PID ]; then
/etc/sysconfig/network-scripts/ifdown-post $1
exit 0