2 [ -z "$1" ] && echo "Error: should be run by udhcpc" && exit 1
6 RESOLV_CONF
="/tmp/resolv.conf"
10 for ifc
in $interfaces; do
11 config_get ifname
$ifc ifname
12 [ "$ifname" = "$interface" ] ||
continue
14 config_get proto
$ifc proto
15 [ "$proto" = "dhcp" ] ||
continue
17 env
-i ACTION
="$1" INTERFACE
="$ifname" PROTO
=dhcp
/sbin
/hotplug iface
23 ifconfig
$interface 0.0.0.0
27 ifconfig
$interface $ip \
28 netmask
${subnet:-255.255.255.0} \
29 broadcast
${broadcast:-+}
31 if [ -n "$router" ] ; then
32 echo "deleting routers"
33 while route del default gw
0.0.0.0 dev
$interface >&- 2>&- ; do :; done
36 echo "adding router $i"
37 route add default gw
$i dev
$interface
41 echo -n > $RESOLV_CONF
42 ${domain:+echo search $domain} >> $RESOLV_CONF
45 echo "nameserver $i" >> $RESOLV_CONF
51 [ -f /etc
/udhcpc.user
] && .
/etc
/udhcpc.user
This page took 0.045022 seconds and 5 git commands to generate.