move platform specific base-files into target/linux/<targetname>
[openwrt.git] / package / base-files / default / usr / share / udhcpc / default.script
index a244e05..53c8faf 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 [ -z "$1" ] && echo "Error: should be run by udhcpc" && exit 1
 . /etc/functions.sh
-include network
+include /lib/network
 
 RESOLV_CONF="/tmp/resolv.conf"
 
@@ -14,7 +14,7 @@ hotplug_event() {
                config_get proto $ifc proto
                [ "$proto" = "dhcp" ] || continue
 
-               env -i ACTION="$1" INTERFACE="$ifname" PROTO=dhcp /sbin/hotplug iface
+               env -i ACTION="$1" INTERFACE="$ifc" DEVICE="$ifname" PROTO=dhcp /sbin/hotplug iface
        done
 }
 
@@ -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
                
This page took 0.025801 seconds and 4 git commands to generate.