aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/ifdown-sl
blob: ea9bae619b8c40d59f8fa0112de0d90cc78f0c35 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
PATH=/sbin:/usr/sbin:/bin:/usr/bin

cd /etc/sysconfig/network-scripts

CONFIG=$1
. network-functions
source_config

# signals ifup-sl not to persist
rm -f /var/run/sl-$DEVICE.dev

PID=`pidof dip-$DEVICE`
if [ -z "$PID" ]; then
  exit 1
fi

kill $PID > /dev/null 2>&1
if [ ! -d /proc/$PID ]; then
  /etc/sysconfig/network-scripts/ifdown-post $1
  exit 0
fi
sleep 2
if [ ! -d /proc/$PID ]; then
  /etc/sysconfig/network-scripts/ifdown-post $1
  exit 0
fi

kill -KILL $PID > /dev/null 2>&1
if [ -d /proc/$PID ]; then
  logger -p daemon.info -t ifdown-ppp "ifdown-ppp unable to kill pppd-$DEVICE" &
else
  /etc/sysconfig/network-scripts/ifdown-post $1
fi

exit 1