From 2a414d387afab0666d8e7055014d9ea0afaf213a Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 20 Dec 2006 04:51:47 +0000 Subject: [PATCH] reorder setting static routes and dns, because the static route assignment overwrites $2 (patch from #1051) SVN-Revision: 5872 --- .../package/base-files/default/etc/functions.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/openwrt/package/base-files/default/etc/functions.sh b/openwrt/package/base-files/default/etc/functions.sh index 6278a0fe28..375121a6ec 100755 --- a/openwrt/package/base-files/default/etc/functions.sh +++ b/openwrt/package/base-files/default/etc/functions.sh @@ -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*) -- 2.30.2