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
="$ifc" DEVICE
="$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
42 echo -n > $RESOLV_CONF
43 ${domain:+echo search $domain} >> $RESOLV_CONF
46 echo "nameserver $i" >> $RESOLV_CONF
53 [ -f /etc
/udhcpc.user
] && .
/etc
/udhcpc.user
This page took 0.049528 seconds and 5 git commands to generate.