From: Felix Fietkau Date: Tue, 3 Oct 2006 19:38:34 +0000 (+0000) Subject: don't recreate the resolv.conf file from the dhcp script if no dhcp server is supplie... X-Git-Tag: reboot~30718^2~92 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=c379f4a159a68f299d85e66b2ebb96e6da206ca0;p=openwrt%2Fstaging%2Fnoltari.git don't recreate the resolv.conf file from the dhcp script if no dhcp server is supplied (reported by exobyte) SVN-Revision: 4903 --- diff --git a/openwrt/package/base-files/default/usr/share/udhcpc/default.script b/openwrt/package/base-files/default/usr/share/udhcpc/default.script index e048687f74..74e703715b 100755 --- a/openwrt/package/base-files/default/usr/share/udhcpc/default.script +++ b/openwrt/package/base-files/default/usr/share/udhcpc/default.script @@ -37,13 +37,15 @@ case "$1" in route add default gw $i dev $interface done fi - - echo -n > $RESOLV_CONF - ${domain:+echo search $domain} >> $RESOLV_CONF - for i in $dns ; do - echo "adding dns $i" - echo "nameserver $i" >> $RESOLV_CONF - done + + [ -n "$dns" ] && { + echo -n > $RESOLV_CONF + ${domain:+echo search $domain} >> $RESOLV_CONF + for i in $dns ; do + echo "adding dns $i" + echo "nameserver $i" >> $RESOLV_CONF + done + } hotplug_event ifup