2 # Copyright (C) 2006 OpenWrt.org
4 [ $# = 0 ] && { echo " $0 <group>"; exit; }
10 debug "### ifdown $cfg ###"
12 config_get proto "$cfg" proto
13 [ -z "$proto" ] && { echo "interface not found."; exit; }
15 # kill active ppp daemon and other processes
16 config_get ifname "$cfg" ifname
17 pids="$(cat /var/run/${ifname}.pid /var/run/ppp-${cfg}.pid 2>/dev/null)"
19 [ -d "/proc/$pid" ] && {
22 [ -d "/proc/$pid" ] && kill -9 $pid
25 rm -f /var/run/${ifname}.pid /var/run/ppp-${cfg}.pid
27 config_get ifname "$cfg" ifname
28 config_get device "$cfg" ifname
30 [ ."$device" != ."$ifname" ] || device=
31 for dev in $ifname $device; do
32 ifconfig "$ifname" 0.0.0.0 down >/dev/null 2>/dev/null
35 config_get iftype "$cfg" type
36 [ "$iftype" = "bridge" ] && brctl delbr "$ifname" >/dev/null 2>/dev/null