]> git.pld-linux.org Git - projects/rc-scripts.git/blame - lib/ifdown-sl
If an iface type is specified NEVER override it
[projects/rc-scripts.git] / lib / ifdown-sl
CommitLineData
6955eb97 1#!/bin/sh
b0443108 2#
b0443108 3#
7742e157
AF
4PATH=/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
10CONFIG=$1
7742e157
AF
11source_config
12
de1fc6ce
JR
13# set all major variables
14setup_ip_param
15
7742e157
AF
16# signals ifup-sl not to persist
17rm -f /var/run/sl-$DEVICE.dev
18
c24e165d 19# we can use dip or direct slip connection via slattach
dd4a755f 20if is_no "$DIRECT_CONNECT"; then
5e6dfc29 21 PID=$(pidof dip-$DEVICE)
c24e165d 22else
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 32fi
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#
38if [ -z "$PID" ]; then
5e6dfc29 39 PID=$(pidof -- -dip\ \($IPADDR\))
12de71be 40fi
7742e157 41if [ -z "$PID" ]; then
5e6dfc29 42 exit 1
7742e157
AF
43fi
44
45kill $PID > /dev/null 2>&1
46if [ ! -d /proc/$PID ]; then
f67ce454 47 /lib/rc-scripts/ifdown-post $1
5e6dfc29 48 exit 0
7742e157
AF
49fi
50sleep 2
51if [ ! -d /proc/$PID ]; then
f67ce454 52 /lib/rc-scripts/ifdown-post $1
5e6dfc29 53 exit 0
7742e157
AF
54fi
55
56kill -KILL $PID > /dev/null 2>&1
57if [ -d /proc/$PID ]; then
5e6dfc29 58 logger -p daemon.info -t ifdown-sl "ifdown-sl unable to kill sl-$DEVICE" &
7742e157 59else
f67ce454 60 /lib/rc-scripts/ifdown-post $1
7742e157
AF
61fi
62
63exit 1
This page took 0.184956 seconds and 4 git commands to generate.