]> git.pld-linux.org Git - projects/rc-scripts.git/blob - sysconfig/network-scripts/ifdown-sl
- preparation for upcoming 0.4.0.1 release
[projects/rc-scripts.git] / sysconfig / network-scripts / ifdown-sl
1 #!/bin/sh
2 #
3 #       $Id$
4 #
5 PATH=/sbin:/usr/sbin:/bin:/usr/bin
6
7 . /etc/sysconfig/network
8 . /etc/rc.d/init.d/functions
9 . /etc/sysconfig/network-scripts/functions.network
10
11 CONFIG=$1
12 source_config
13
14 # set all major variables
15 setup_ip_param
16
17 # signals ifup-sl not to persist
18 rm -f /var/run/sl-$DEVICE.dev
19
20 # we can use dip or direct slip connection via slattach
21 if is_no "$DIRECT_CONNECT"; then
22 PID=$(pidof dip-$DEVICE)
23 else
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 "signal TERM send to \"$(ps -o cmd= $x)\" - this should be slattach"
28         kill -TERM $x
29         PID=$x
30         fi
31 done
32 fi
33 #
34 # The proctitle for connected dip daemons is actually "-dip (ipaddr)"
35 #       with ipaddr = local on dial-out,  remote on dial-in
36 # Grab the PID of connected dial-out daemon.
37 #
38 if [ -z "$PID" ]; then
39   PID=$(pidof -- -dip\ \($IPADDR\))
40 fi
41 if [ -z "$PID" ]; then
42   exit 1
43 fi
44
45 kill $PID > /dev/null 2>&1
46 if [ ! -d /proc/$PID ]; then
47   /etc/sysconfig/network-scripts/ifdown-post $1
48   exit 0
49 fi
50 sleep 2
51 if [ ! -d /proc/$PID ]; then
52   /etc/sysconfig/network-scripts/ifdown-post $1
53   exit 0
54 fi
55
56 kill -KILL $PID > /dev/null 2>&1
57 if [ -d /proc/$PID ]; then
58   logger -p daemon.info -t ifdown-sl "ifdown-sl unable to kill sl-$DEVICE" &
59 else
60   /etc/sysconfig/network-scripts/ifdown-post $1
61 fi
62
63 exit 1
64
65
66 # This must be last line !
67 # vi:syntax=sh:tw=78:ts=8:sw=4
This page took 0.025378 seconds and 3 git commands to generate.