2 # Copyright (C) 2006 OpenWrt.org
5 [ $# = 0 ] && { echo " $0 <group>"; exit; }
7 [ -e "/tmp/resolv.conf.auto" ] && rm /tmp
/resolv.conf.auto
9 [ interface
!= "$1" -o -z "$2" ] ||
eval "$0 $2"
19 debug
"### ifdown $cfg ###"
21 config_get proto
"$cfg" proto
22 [ -z "$proto" ] && { echo "interface not found."; exit; }
24 config_get iface
"$cfg" device
25 [ "static" = "$proto" -o "none" = "$proto" ] && {
26 env
-i ACTION
="ifdown" INTERFACE
="$cfg" DEVICE
="$iface" PROTO
="$proto" /sbin
/hotplug-call
"iface"
29 # call interface stop handler
30 ( type "stop_interface_$proto" ) >/dev
/null
2>/dev
/null
&& eval "stop_interface_$proto '$cfg'"
32 config_get ifname
"$cfg" ifname
33 config_get device
"$cfg" device
35 [ .
"$device" != .
"$ifname" ] || device
=
36 for dev
in $ifname $device; do
37 ifconfig
"$dev" 0.0.0.0 down
>/dev
/null
2>/dev
/null
40 config_get iftype
"$cfg" type
41 [ "bridge" = "$iftype" ] && brctl delbr
"$ifname" >/dev
/null
2>/dev
/null
43 # remove the interface's dns entries
46 # remove the interface's network state
47 uci_revert_state network
"$1"
49 # revert aliases state as well
50 config_get aliases
"$1" aliases
51 for config
in $aliases; do
52 uci_revert_state network
"$config"
This page took 0.061111 seconds and 5 git commands to generate.