diff options
author | Felix Fietkau <nbd@openwrt.org> | 2006-10-03 19:38:34 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2006-10-03 19:38:34 +0000 |
commit | 7e9bc6aacd01144117e76051aa9e9cbe21e3d8da (patch) | |
tree | 61017efff3ed98bd632c97b1a5e71b1057cafb2f /package/base-files | |
parent | b080ba4b58c3e30f21f6987273cb3f9588fdc19c (diff) | |
download | upstream-7e9bc6aacd01144117e76051aa9e9cbe21e3d8da.tar.gz upstream-7e9bc6aacd01144117e76051aa9e9cbe21e3d8da.tar.bz2 upstream-7e9bc6aacd01144117e76051aa9e9cbe21e3d8da.zip |
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
Diffstat (limited to 'package/base-files')
-rwxr-xr-x | package/base-files/default/usr/share/udhcpc/default.script | 16 |
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 e048687f74..74e703715b 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 |