]> git.pld-linux.org Git - projects/rc-scripts.git/blame - sysconfig/network-scripts/ifdown-ppp
added abilities for setup static RARP table by
[projects/rc-scripts.git] / sysconfig / network-scripts / ifdown-ppp
CommitLineData
6955eb97 1#!/bin/sh
b0443108 2#
cf37a775 3# $Id: ifdown-ppp,v 1.9 2000/04/21 17:44:22 jajcus Exp $
b0443108 4#
7742e157
AF
5PATH=/sbin:/usr/sbin:/bin:/usr/bin
6
f3002e12
JK
7. /etc/sysconfig/network
8. /etc/rc.d/init.d/functions
8b3e2b71 9. /etc/sysconfig/network-scripts/.functions
7742e157
AF
10
11CONFIG=$1
7742e157
AF
12source_config
13
cf37a775 14if [ ! -f /var/run/ppp-$DEVICE.pid ]; then
7742e157
AF
15 # ppp isn't running, or we didn't start it
16 exit 0
17fi
18
cf37a775 19get_ppp_device_and_pid
7742e157 20
7742e157
AF
21if [ -z "$PID" ]; then
22 exit 1
23fi
24
cf37a775
JK
25rm -f /var/run/ppp-$DEVICE.pid
26
7742e157
AF
27# pppd might have chat as a child; remember chat's pid to kill after pppd.
28# (After, not before, so that pppd doesn't just restart it).
29
d29c401a 30CHATPID=`ps axl | awk '$4 ~ /^'"$PID"'$/ {print $3}' 2>/dev/null`
7742e157
AF
31
32kill $PID > /dev/null 2>&1
33[ -n "$CHATPID" ] && kill $CHATPID > /dev/null 2>&1
34if [ ! -d /proc/$PID ]; then
35 /etc/sysconfig/network-scripts/ifdown-post $1
36 exit 0
37fi
38sleep 2
39if [ ! -d /proc/$PID ]; then
40 /etc/sysconfig/network-scripts/ifdown-post $1
41 exit 0
42fi
43
44kill -KILL $PID > /dev/null 2>&1
45if [ -d /proc/$PID ]; then
46 logger -p daemon.info -t ifdown-ppp "ifdown-ppp unable to kill pppd-$DEVICE" &
47else
48 /etc/sysconfig/network-scripts/ifdown-post $1
49fi
50
51exit 1
This page took 0.0422090000000001 seconds and 4 git commands to generate.