2 # Sample udhcpc bound/renew script
4 # Uncomment this to allow dhcpcd to set hostname of the host to the
5 # hostname option supplied by DHCP server.
8 RESOLV_CONF="/etc/resolv.conf"
10 [ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
11 [ -n "$subnet" ] && NETMASK="netmask $subnet"
13 /sbin/ifconfig $interface $ip $BROADCAST $NETMASK
15 if [ -n "$hostname" -a -n "$SET_HOSTNAME" ]
17 local current_hostname=$(hostname)
18 if [ -z "$current_hostname" -o "$current_hostname" = "(none)" ]; then
25 echo "deleting routers"
26 while /sbin/route del default gw 0.0.0.0 dev $interface
32 /sbin/route add default gw $i dev $interface
36 # Update resolver configuration file
38 [ -n "$domain" ] && R="domain $domain
47 if [ -x /sbin/resolvconf ] ; then
48 echo -n "$R" | resolvconf -a "${interface}.udhcpc"
50 echo -n "$R" > "$RESOLV_CONF"