-do_ifup() {
- if_proto=$(nvram get ${2}_proto)
- if=$(nvram get ${2}_ifname)
- [ "${if%%[0-9]}" = "ppp" ] && if=$(nvram get ${if_proto}_ifname)
-
- pidfile=/var/run/${if}.pid
- [ -f $pidfile ] && $DEBUG kill $(cat $pidfile)
-
- case "$1" in
- static)
- ip=$(nvram get ${2}_ipaddr)
- netmask=$(nvram get ${2}_netmask)
- gateway=$(nvram get ${2}_gateway)
-
- $DEBUG ifconfig $if $ip ${netmask:+netmask $netmask} broadcast + up
- ${gateway:+$DEBUG route add default gw $gateway}