source: projects/initscripts/trunk/sysconfig/network-scripts/ifdown-ppp @ 4352

Revision 4352, 1.1 KB checked in by daisuke, 13 years ago (diff)

use pppoe-{start,stop} instead of adsl-{start,stop}

Line 
1#! /bin/bash
2
3cd /etc/sysconfig/network-scripts
4. /etc/sysconfig/network-scripts/network-functions
5
6CONFIG=$1
7source_config
8
9if [ "$TYPE" = "xDSL" ] && [ -x /sbin/pppoe-stop -o -x /usr/sbin/pppoe-stop ] ; then
10    pppoe-stop /etc/sysconfig/network-scripts/$CONFIG
11    exit $?
12fi
13
14CONFIG=${CONFIG##ifcfg-}
15
16if [ "${DEMAND}" = "yes" -a -f /var/run/ppp-${CONFIG}.pid ] ; then
17    PID=`head -1 /var/run/ppp-${CONFIG}.pid`
18    kill -TERM ${PID}
19    sleep 2
20    [ ! -d /proc/${PID} ] && exit 0
21    sleep 5
22    [ ! -d /proc/${PID} ] && exit 0
23    kill -TERM ${PID}
24    [ ! -d /proc/${PID} ] && exit 0
25    exit 1
26fi
27
28file=/var/run/pppwatch-${DEVICE}.pid
29
30if [ ! -f $file ]; then
31    # ppp isn't running, or we didn't start it
32    exit 0
33fi
34
35PID=`cat $file`
36[ -n "${PID}" ] || exit 1
37
38kill -TERM ${PID} > /dev/null 2>&1
39[ ! -d /proc/${PID} ] && exit 0
40sleep 2
41[ ! -d /proc/${PID} ] && exit 0
42sleep 5
43[ ! -d /proc/${PID} ] && exit 0
44sleep 10
45[ ! -d /proc/${PID} ] && exit 0
46
47# killing ppp-watch twice in a row causes it to send a SIGKILL to pppd pgrp
48kill -TERM ${PID} > /dev/null 2>&1
49[ ! -d /proc/${PID} ] && exit 0
50
51exit 1
Note: See TracBrowser for help on using the repository browser.