2 [ -z "$1" ] && echo "Error: should be run by udhcpc" && exit 1
5 RESOLV_CONF="/tmp/resolv.conf"
8 for ifname in lan wan wifi ${ifnames}; do
9 eval "proto=\"\${${ifname}_proto}\""
10 eval "if=\"\${${ifname}_ifname}\""
11 [ "$proto" = "dhcp" ] || continue
12 [ "$if" = "$interface" ] || continue
13 env -i ACTION="$1" INTERFACE="$ifname" PROTO=dhcp /sbin/hotplug iface
19 ifconfig $interface 0.0.0.0
23 ifconfig $interface $ip \
24 netmask ${subnet:-255.255.255.0} \
25 broadcast ${broadcast:-+}
27 if [ -n "$router" ] ; then
28 echo "deleting routers"
29 while route del default gw 0.0.0.0 dev $interface >&- 2>&- ; do :; done
32 echo "adding router $i"
33 route add default gw $i dev $interface
37 echo -n > $RESOLV_CONF
38 ${domain:+echo search $domain} >> $RESOLV_CONF
41 echo "nameserver $i" >> $RESOLV_CONF
47 [ -f /etc/udhcpc.user ] && . /etc/udhcpc.user