let ipkg fail when a package file to be installed is not found
[openwrt/openwrt.git] / openwrt / package / base-files / default / sbin / ifup
1 #!/bin/sh
2 [ $# = 0 ] && { echo " $0 <group>"; exit; }
3 . /etc/functions.sh
4 . /etc/config/network
5
6 ifdown $1
7
8 debug "### ifup $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 register atm0; exit 0 ;;
17 pppoe)
18 # PPPoE over ATM
19 [ "$if" = "nas0" ] && {
20 ifconfig nas0 2>&- >&- || {
21 hotplug_dev register atm0
22 exit 0
23 }
24 }
25 ;;
26 none|"") exit 0;;
27 esac
28
29 if [ "${if%%[0-9]}" = "br" ]; then
30 eval "ifnames=\"\${${type}_ifnames}\""
31 for sif in $ifnames; do
32 hotplug_dev register "$sif"
33 done
34 else
35 hotplug_dev register "$if"
36 fi