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