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