50ffee53040bb5e76cb23f822c1e89a106bbf481
[openwrt-10.03/.git] / package / base-files / default / sbin / ifdown
1 #!/bin/sh
2 # Copyright (C) 2006 OpenWrt.org
3
4 [ $# = 0 ] && { echo "  $0 <group>"; exit; }
5 . /etc/functions.sh
6 . /etc/config/network
7
8 debug "### ifdown $type ###"
9 type=$1
10
11 eval "if_proto=\"\${${type}_proto}\""
12 eval "if=\"\${${type}_ifname}\""
13 [ "${if%%[0-9]}" = "ppp" ] && eval "if=\"\${${type}_device}\""
14
15 case "$if_proto" in
16         pppoa) hotplug_dev unregister atm0; exit 0 ;;
17         ""|none) exit 0;;
18 esac
19
20 hotplug_dev unregister "$if"