2 [ -z "$1" ] && echo "Error: should be run by udhcpc" && exit 1
4 RESOLV_CONF
="/tmp/resolv.conf"
7 nvram show
2>&- |
grep _proto
=dhcp |
{
10 [ -z "$FOO" ] && break
12 [ "$(nvram get ${FOO}_ifname)" = "${interface}" ] ||
continue
13 env
-i ACTION
="$1" INTERFACE
="${FOO}" PROTO
=dhcp
/sbin
/hotplug iface
20 ifconfig
$interface 0.0.0.0
24 ifconfig
$interface $ip \
25 netmask
${subnet:-255.255.255.0} \
26 broadcast
${broadcast:-+}
28 if [ -n "$router" ] ; then
30 if [ "$router" != "$(route -n | grep '^0.0.0.0' | grep $interface | awk '{ print $2 }')" ] ; then
31 echo "deleting routers"
32 while route del default gw
0.0.0.0 dev
$interface ; do :; done
34 route add default gw
$i dev
$interface
39 echo -n > $RESOLV_CONF
40 ${domain:+echo search $domain} >> $RESOLV_CONF
43 echo nameserver
$i >> $RESOLV_CONF
49 [ -f /etc
/udhcpc.user
] && .
/etc
/udhcpc.user
This page took 0.062001 seconds and 5 git commands to generate.