summaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
Diffstat (limited to 'package')
-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