]> git.pld-linux.org Git - projects/rc-scripts.git/blame - sysconfig/network-scripts/ifdown-sl
- /etc/rc.d/init.d//network.functions moved to
[projects/rc-scripts.git] / sysconfig / network-scripts / ifdown-sl
CommitLineData
6955eb97 1#!/bin/sh
b0443108 2#
8b3e2b71 3# $Id: ifdown-sl,v 1.9 1999/10/13 21:28:40 kloczek 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
8b3e2b71 9. /etc/sysconfig/network-scripts/.functions
7742e157
AF
10
11CONFIG=$1
7742e157
AF
12source_config
13
14# signals ifup-sl not to persist
15rm -f /var/run/sl-$DEVICE.dev
16
c24e165d
AM
17# we can use dip or direct slip connection via slattach
18if [ "$DIRECT_CONNECT" != "yes" ]; then
7742e157 19PID=`pidof dip-$DEVICE`
c24e165d
AM
20else
21PID=`pidof slattach`
22for x in $PID; do
23 if grep -q "$MODEMPORT" /proc/$x/cmdline; then
24 logger -p daemon.info -t ifdown-sl "signal TERM send to \"`ps -o cmd= $x`\" - this should be slattach"
25 kill -TERM $x
26 PID=$x
27 fi
28done
29fi
12de71be 30#
31# The proctitle for connected dip daemons is actually "-dip (ipaddr)"
830949ca 32# with ipaddr = local on dial-out, remote on dial-in
12de71be 33# Grab the PID of connected dial-out daemon.
34#
35if [ -z "$PID" ]; then
36 PID=`pidof -- -dip\ \($IPADDR\)`
37fi
7742e157
AF
38if [ -z "$PID" ]; then
39 exit 1
40fi
41
42kill $PID > /dev/null 2>&1
43if [ ! -d /proc/$PID ]; then
44 /etc/sysconfig/network-scripts/ifdown-post $1
45 exit 0
46fi
47sleep 2
48if [ ! -d /proc/$PID ]; then
49 /etc/sysconfig/network-scripts/ifdown-post $1
50 exit 0
51fi
52
53kill -KILL $PID > /dev/null 2>&1
54if [ -d /proc/$PID ]; then
55 logger -p daemon.info -t ifdown-ppp "ifdown-ppp unable to kill pppd-$DEVICE" &
56else
57 /etc/sysconfig/network-scripts/ifdown-post $1
58fi
59
60exit 1
61
This page took 0.044521 seconds and 4 git commands to generate.