summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2006-10-03 19:38:34 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2006-10-03 19:38:34 +0000
commitb9f75a560dedd426db89cb74b16aaad85b0f50be (patch)
tree61017efff3ed98bd632c97b1a5e71b1057cafb2f
parent5005fb433a73ce160958cb12857da2682ef1a294 (diff)
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
-rwxr-xr-xpackage/base-files/default/usr/share/udhcpc/default.script16
1 files 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