# Update domain name server IPv4 addresses and # restart udhcpd on reconfiguration of the interface. RESOLV_CONF="/etc/resolv.conf" UDHCPD_CONF="/tmp/udhcpd.conf" UDHCPD_CONF_TEMPLATE="/etc/udhcpd.conf" if $if_configured; then [ ! -f "$RESOLV_CONF" ] && return # Filter resolv.conf to get the IPv4 name servers # only. dns=$(grep -F nameserver $RESOLV_CONF | cut -c 12- | grep -E "^[0-9\.]*$") cat $UDHCPD_CONF_TEMPLATE \ | sed "s!%%DNS%%!$dns!" \ > $UDHCPD_CONF chmod a+r "$UDHCPD_CONF" service udhcpd --ifstarted restart fi