]> git.pld-linux.org Git - projects/rc-scripts.git/blob - sysconfig/network-scripts/ifdown-ppp
Set interface used by EAGLE driver to down when downing ppp interface.
[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-$DEVNAME.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-$DEVNAME.pid
28
29 [ ! -d /proc/${PID} ] && exit 0
30
31 kill -TERM ${PID} > /dev/null 2>&1
32
33 sleep 2
34 [ -d /proc/${PID} ] && sleep 2 && [ -d /proc/${PID} ] && sleep 5
35
36 kill -KILL ${PID} > /dev/null 2>&1
37 logger -p daemon.info -t ifdown-ppp "ifdown-ppp unable to nicely kill pppd-$DEVICE (pppd-$DEVNAME)" &
38
39 # Special cases
40 if is_yes "${PPPOA_EAGLE}"; then
41     EAGLECTRL="/usr/sbin/adictrl"
42     if [ ! -x $EAGLECTRL ]; then
43         EAGLECTRL="/usr/sbin/eaglectrl"
44     fi
45     if [ -x $EAGLECTRL ]; then
46         PPPOA_IFACE=$( $EAGLECTRL -i 2>/dev/null)
47         [ -n "$PPPOA_IFACE" ] && ip link set "$PPPOA_IFACE" down
48     fi
49 fi
50
51 /etc/sysconfig/network-scripts/ifdown-post $1
52
53 exit 1
54
55 # This must be last line !
56 # vi:syntax=sh:tw=78:ts=8:sw=4
57
This page took 0.0286 seconds and 3 git commands to generate.