From b9f75a560dedd426db89cb74b16aaad85b0f50be Mon Sep 17 00:00:00 2001 From: nbd Date: Tue, 3 Oct 2006 19:38:34 +0000 Subject: don't recreate the resolv.conf file from the dhcp script if no dhcp server is supplied (reported by exobyte) git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@4903 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../base-files/default/usr/share/udhcpc/default.script | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/package/base-files/default/usr/share/udhcpc/default.script b/package/base-files/default/usr/share/udhcpc/default.script index e048687f7..74e703715 100755 --- a/package/base-files/default/usr/share/udhcpc/default.script +++ b/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 -- cgit v1.2.3