don't recreate the resolv.conf file from the dhcp script if no dhcp server is supplie...
authorFelix Fietkau <nbd@openwrt.org>
Tue, 3 Oct 2006 19:38:34 +0000 (19:38 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Tue, 3 Oct 2006 19:38:34 +0000 (19:38 +0000)
SVN-Revision: 4903

openwrt/package/base-files/default/usr/share/udhcpc/default.script

index e94ef02694b6394efd5b847be5c578475119ea7d..20d306de4b18ea90a263b243c39f1c7ca9cb1580 100755 (executable)
@@ -35,12 +35,14 @@ case "$1" in
                        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