]> git.pld-linux.org Git - projects/rc-scripts.git/blob - sysconfig/network-scripts/ifdown-ppp
- preparation for upcoming 0.4.0.1 release
[projects/rc-scripts.git] / sysconfig / network-scripts / ifdown-ppp
1 #!/bin/sh
2 #
3 #       $Id$
4 #
5 PATH=/sbin:/usr/sbin:/bin:/usr/bin
6
7 . /etc/sysconfig/network
8 . /etc/rc.d/init.d/functions
9 . /etc/sysconfig/network-scripts/functions.network
10
11 CONFIG=$1
12 source_config
13
14 if [ ! -f /var/run/ppp-$DEVICE.pid ]; then
15     # ppp isn't running, or we didn't start it
16     exit 0
17 fi
18
19 # set all major variables
20 setup_ip_param
21 get_ppp_device_and_pid
22
23 if [ -z "$PID" ]; then
24     exit 1
25 fi
26
27 rm -f /var/run/ppp-$DEVICE.pid
28
29 [ ! -d /proc/${PID} ] && exit 0
30
31 kill -TERM ${PID} > /dev/null 2>&1
32
33 sleep 2
34 if [ ! -d /proc/${PID} ]; then
35     /etc/sysconfig/network-scripts/ifdown-post $1
36     exit 0
37 fi
38
39 sleep 2
40 [ -d /proc/${PID} ] && sleep 5
41
42 if [ ! -d /proc/${PID} ]; then
43     /etc/sysconfig/network-scripts/ifdown-post $1
44     exit 0
45 fi
46
47 kill -KILL ${PID} > /dev/null 2>&1
48 logger -p daemon.info -t ifdown-ppp "ifdown-ppp unable to nicely kill pppd-$DEVICE" &
49
50 exit 1
51
52 # This must be last line !
53 # vi:syntax=sh:tw=78:ts=8:sw=4
54
This page took 0.062998 seconds and 3 git commands to generate.