From c379f4a159a68f299d85e66b2ebb96e6da206ca0 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 3 Oct 2006 19:38:34 +0000 Subject: [PATCH] don't recreate the resolv.conf file from the dhcp script if no dhcp server is supplied (reported by exobyte) SVN-Revision: 4903 --- .../default/usr/share/udhcpc/default.script | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) 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 e048687f746..74e703715b7 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 -- 2.30.2