]> git.pld-linux.org Git - projects/rc-scripts.git/blame - sysconfig/network-scripts/ifdown-sl
- merge my private tree
[projects/rc-scripts.git] / sysconfig / network-scripts / ifdown-sl
CommitLineData
6955eb97 1#!/bin/sh
b0443108 2#
7824432b 3# $Id: ifdown-sl,v 1.10.2.2 2001/09/30 10:19:42 misiek Exp $
b0443108 4#
7742e157
AF
5PATH=/sbin:/usr/sbin:/bin:/usr/bin
6
f3002e12
JK
7. /etc/sysconfig/network
8. /etc/rc.d/init.d/functions
7824432b 9. /etc/sysconfig/network-scripts/functions.network
7742e157
AF
10
11CONFIG=$1
7742e157
AF
12source_config
13
a04d924e
AM
14# set all major variables
15setup_ip_param
16
7742e157
AF
17# signals ifup-sl not to persist
18rm -f /var/run/sl-$DEVICE.dev
19
c24e165d 20# we can use dip or direct slip connection via slattach
dd4a755f 21if is_no "$DIRECT_CONNECT"; then
a04d924e 22PID=$(pidof dip-$DEVICE)
c24e165d 23else
a04d924e 24PID=$(pidof slattach)
c24e165d
AM
25for x in $PID; do
26 if grep -q "$MODEMPORT" /proc/$x/cmdline; then
a04d924e 27 logger -p daemon.info -t ifdown-sl "signal TERM send to \"$(ps -o cmd= $x)\" - this should be slattach"
c24e165d
AM
28 kill -TERM $x
29 PID=$x
30 fi
31done
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
a04d924e 39 PID=$(pidof -- -dip\ \($IPADDR\))
12de71be 40fi
7742e157
AF
41if [ -z "$PID" ]; then
42 exit 1
43fi
44
45kill $PID > /dev/null 2>&1
46if [ ! -d /proc/$PID ]; then
47 /etc/sysconfig/network-scripts/ifdown-post $1
48 exit 0
49fi
50sleep 2
51if [ ! -d /proc/$PID ]; then
52 /etc/sysconfig/network-scripts/ifdown-post $1
53 exit 0
54fi
55
56kill -KILL $PID > /dev/null 2>&1
57if [ -d /proc/$PID ]; then
7824432b 58 logger -p daemon.info -t ifdown-sl "$(nls 'ifdown-%s unable to kill %s for %s' "sl" "slattach" "$DEVICE")" &
7742e157
AF
59else
60 /etc/sysconfig/network-scripts/ifdown-post $1
61fi
62
63exit 1
64
a04d924e
AM
65
66# This must be last line !
67# vi:syntax=sh:tw=78:ts=8:sw=4
68
This page took 0.12451 seconds and 4 git commands to generate.