2 # Copyright (C) 2006 OpenWrt.org
5 [ $# = 0 ] && { echo " $0 <group>"; exit; }
8 [ interface
!= "$1" -o -z "$2" ] ||
eval "$0 $2"
17 debug
"### ifdown $cfg ###"
19 config_get proto
"$cfg" proto
20 [ -z "$proto" ] && { echo "interface not found."; exit; }
22 config_get iface
"$cfg" device
23 [ "$proto" = "static" ] && {
24 env
-i ACTION
="ifdown" INTERFACE
="$cfg" DEVICE
="$iface" PROTO
=static
/sbin
/hotplug-call
"iface" &
27 # call interface stop handler
28 ( type "stop_interface_$proto" ) >/dev
/null
2>/dev
/null
&& eval "stop_interface_$proto '$cfg'"
30 # make sure all locks are removed
31 for lock
in "/var/lock/dhcp-$iface" "/var/lock/ppp-$iface"; do
38 # kill active ppp daemon and other processes
39 config_get ifname
"$cfg" ifname
40 pids
="$(head -n1 -q /var/run/${ifname}.pid /var/run/ppp-${cfg}.pid 2>/dev/null)"
42 [ -d "/proc/$pid" ] && {
44 [ -d "/proc/$pid" ] && {
46 kill -9 $pid 2>/dev
/null
>/dev
/null
50 rm -f /var
/run
/${ifname}.pid
/var
/run
/ppp-
${cfg}.pid
52 config_get ifname
"$cfg" ifname
53 config_get device
"$cfg" device
55 [ .
"$device" != .
"$ifname" ] || device
=
56 for dev
in $ifname $device; do
57 ifconfig
"$dev" 0.0.0.0 down
>/dev
/null
2>/dev
/null
60 config_get iftype
"$cfg" type
61 [ "$iftype" = "bridge" ] && brctl delbr
"$ifname" >/dev
/null
2>/dev
/null
This page took 0.047635 seconds and 5 git commands to generate.