]>
Commit | Line | Data |
---|---|---|
6955eb97 | 1 | #!/bin/sh |
b0443108 | 2 | # |
8b3e2b71 | 3 | # $Id: ifdown-sl,v 1.9 1999/10/13 21:28:40 kloczek Exp $ |
b0443108 | 4 | # |
7742e157 AF |
5 | PATH=/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 | |
11 | CONFIG=$1 | |
7742e157 AF |
12 | source_config |
13 | ||
14 | # signals ifup-sl not to persist | |
15 | rm -f /var/run/sl-$DEVICE.dev | |
16 | ||
c24e165d AM |
17 | # we can use dip or direct slip connection via slattach |
18 | if [ "$DIRECT_CONNECT" != "yes" ]; then | |
7742e157 | 19 | PID=`pidof dip-$DEVICE` |
c24e165d AM |
20 | else |
21 | PID=`pidof slattach` | |
22 | for x in $PID; do | |
23 | if grep -q "$MODEMPORT" /proc/$x/cmdline; then | |
24 | logger -p daemon.info -t ifdown-sl "signal TERM send to \"`ps -o cmd= $x`\" - this should be slattach" | |
25 | kill -TERM $x | |
26 | PID=$x | |
27 | fi | |
28 | done | |
29 | fi | |
12de71be | 30 | # |
31 | # The proctitle for connected dip daemons is actually "-dip (ipaddr)" | |
830949ca | 32 | # with ipaddr = local on dial-out, remote on dial-in |
12de71be | 33 | # Grab the PID of connected dial-out daemon. |
34 | # | |
35 | if [ -z "$PID" ]; then | |
36 | PID=`pidof -- -dip\ \($IPADDR\)` | |
37 | fi | |
7742e157 AF |
38 | if [ -z "$PID" ]; then |
39 | exit 1 | |
40 | fi | |
41 | ||
42 | kill $PID > /dev/null 2>&1 | |
43 | if [ ! -d /proc/$PID ]; then | |
44 | /etc/sysconfig/network-scripts/ifdown-post $1 | |
45 | exit 0 | |
46 | fi | |
47 | sleep 2 | |
48 | if [ ! -d /proc/$PID ]; then | |
49 | /etc/sysconfig/network-scripts/ifdown-post $1 | |
50 | exit 0 | |
51 | fi | |
52 | ||
53 | kill -KILL $PID > /dev/null 2>&1 | |
54 | if [ -d /proc/$PID ]; then | |
55 | logger -p daemon.info -t ifdown-ppp "ifdown-ppp unable to kill pppd-$DEVICE" & | |
56 | else | |
57 | /etc/sysconfig/network-scripts/ifdown-post $1 | |
58 | fi | |
59 | ||
60 | exit 1 | |
61 |