2 [ $# = 0 ] && { echo " $0 <group>"; exit; }
4 .
/etc
/network.overrides
5 [ "$FAILSAFE" != "true" -a -e /etc
/config
/network
] && .
/etc
/config
/network
8 debug
"### ifup $type ###"
10 if_proto
=$
(nvram get
${type}_proto
)
11 [ "${if_proto}" = "pppoa" ] ||
{
12 if=$
(nvram get
${type}_ifname
)
13 [ "${if%%[0-9]}" = "ppp" ] && if=$
(nvram get
${if_proto}_ifname
)
16 mac
=$
(nvram get
${type}_hwaddr
)
17 $DEBUG ifconfig
$if down
2>&-
19 pidfile
=/var
/run
/${if}.pid
20 [ -f $pidfile ] && $DEBUG kill $
(cat $pidfile)
22 if [ "${if%%[0-9]}" = "br" ]; then
23 stp
=$
(nvram get
${type}_stp
)
24 $DEBUG brctl delbr
$if 2>&-
25 $DEBUG brctl addbr
$if
26 $DEBUG brctl setfd
$if 0
27 $DEBUG brctl stp
$if ${stp:-0}
29 for sif
in $
(nvram get
${type}_ifnames
); do
30 if_valid
$sif ||
continue
31 ${mac:+$DEBUG ifconfig $sif down hw ether $mac}
32 $DEBUG ifconfig
$sif 0.0.0.0 up
33 $DEBUG brctl addif
$if $sif
36 ${mac:+$DEBUG ifconfig $if down hw ether $mac}
42 ip
=$
(nvram get
${type}_ipaddr
)
43 netmask
=$
(nvram get
${type}_netmask
)
44 gateway
=$
(nvram get
${type}_gateway
)
46 $DEBUG ifconfig
$if $ip ${netmask:+netmask $netmask} broadcast
+ up
47 ${gateway:+$DEBUG route add default gw $gateway}
49 [ -f /etc
/resolv.conf
] && return
51 debug
"# --- creating /etc/resolv.conf ---"
52 for dns
in $
(nvram get
${type}_dns
); do
53 echo "nameserver $dns" >> /etc
/resolv.conf
57 ip
=$
(nvram get
${type}_ipaddr
)
58 ${DEBUG:-eval} "udhcpc -R -i $if ${ip:+-r $ip} -b -p $pidfile &"
63 [ -x "/sbin/ifup.${if_proto}" ] && { $DEBUG /sbin/ifup.${if_proto} $*; exit; }
64 echo "### ifup $type: ignored ${type}_proto=\"$if_proto\" (not supported)"
This page took 0.050358 seconds and 5 git commands to generate.