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