reorganize/rationalize/format package menuconfig,
[openwrt.git] / openwrt / package / base-files / default / sbin / ifup
1 #!/bin/ash
2 [ $# = 0 ] && { echo " $0 <group>"; exit; }
3
4 . /etc/functions.sh
5 . /etc/network.overrides
6 [ "$FAILSAFE" != "true" -a -e /etc/config/network ] && . /etc/config/network
7
8 type=$1
9 debug "### ifup $type ###"
10
11 if_proto=$(nvram get ${type}_proto)
12 if=$(nvram get ${type}_ifname)
13 [ "${if%%[0-9]}" = "ppp" ] && if=$(nvram get ${if_proto}_ifname)
14
15 if_valid $if || [ "$if_proto" = "pptp" ] || exit
16 mac=$(nvram get ${type}_hwaddr)
17 $DEBUG ifconfig $if down 2>&-
18
19 if [ "${if%%[0-9]}" = "br" ]; then
20 stp=$(nvram get ${type}_stp)
21 $DEBUG brctl delbr $if 2>&-
22 $DEBUG brctl addbr $if
23 $DEBUG brctl setfd $if 0
24 $DEBUG brctl stp $if ${stp:-0}
25
26 for sif in $(nvram get ${type}_ifnames); do
27 if_valid $sif || continue
28 ${mac:+$DEBUG ifconfig $sif down hw ether $mac}
29 $DEBUG ifconfig $sif 0.0.0.0 up
30 $DEBUG brctl addif $if $sif
31 done
32 else
33 ${mac:+$DEBUG ifconfig $if down hw ether $mac}
34 fi
35
36 do_ifup $if_proto $type
This page took 0.061664 seconds and 5 git commands to generate.