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
29 echo "deleting routers"
30 while route del default gw
0.0.0.0 dev
$interface ; do :; done
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
This page took 0.052992 seconds and 5 git commands to generate.