reorder setting static routes and dns, because the static route assignment overwrites...
authorFelix Fietkau <nbd@openwrt.org>
Wed, 20 Dec 2006 04:51:47 +0000 (04:51 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Wed, 20 Dec 2006 04:51:47 +0000 (04:51 +0000)
SVN-Revision: 5872

openwrt/package/base-files/default/etc/functions.sh

index 6278a0fe2886fa801f05b8c7d3880f0ae16176a6..375121a6ecaf8166b48e554a8a0260e9ba98c185 100755 (executable)
@@ -44,6 +44,13 @@ do_ifup() {
                $DEBUG ifconfig $if $ip ${netmask:+netmask $netmask} ${mtu:+mtu $(($mtu))} broadcast + up
                ${gateway:+$DEBUG route add default gw $gateway}
 
+               [ -f /tmp/resolv.conf.auto ] || {
+                       debug "# --- creating /tmp/resolv.conf.auto ---"
+                       for dns in $(nvram get ${2}_dns); do
+                               echo "nameserver $dns" >> /tmp/resolv.conf.auto
+                       done
+               }
+               
                [ -n "$static_route" ] && {
                        for route in $static_route; do {
                        eval "set $(echo $route | sed 's/:/ /g')"
@@ -54,13 +61,6 @@ do_ifup() {
                        } done
                }
 
-               [ -f /tmp/resolv.conf.auto ] || {
-                       debug "# --- creating /tmp/resolv.conf.auto ---"
-                       for dns in $(nvram get ${2}_dns); do
-                               echo "nameserver $dns" >> /tmp/resolv.conf.auto
-                       done
-               }
-               
                env -i ACTION="ifup" INTERFACE="${2}" PROTO=static /sbin/hotplug "iface" &
        ;;
        dhcp*)