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-Url: http://git.lede-project.org./?a=commitdiff_plain;h=97780e89bf317afcd6c5003fb2e1faecafbf755c;p=openwrt%2Fsvn-archive%2Farchive.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 e94ef02694..20d306de4b 100755 --- a/openwrt/package/base-files/default/usr/share/udhcpc/default.script +++ b/openwrt/package/base-files/default/usr/share/udhcpc/default.script @@ -35,12 +35,14 @@ case "$1" in 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