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 e048687f7469cae01bf12fd0efaf1d6330c851a5..74e703715b7cde9b5daf510575a221298c5dd22f 100755 (executable)
@@ -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