aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/lib/network
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2007-06-16 00:01:33 +0000
committerFelix Fietkau <nbd@openwrt.org>2007-06-16 00:01:33 +0000
commit97ca42e813d5a0a03bd1a70576375dad8469044a (patch)
tree90b0a4b1f403fbf8f0c1576ca1ea25d8fe4af8ee /package/base-files/files/lib/network
parent947b9e0e9501105e71916c58dcbc67501f677bed (diff)
downloadmaster-187ad058-97ca42e813d5a0a03bd1a70576375dad8469044a.tar.gz
master-187ad058-97ca42e813d5a0a03bd1a70576375dad8469044a.tar.bz2
master-187ad058-97ca42e813d5a0a03bd1a70576375dad8469044a.zip
keep track of the network interface states (stored in uci format in /var/state/network, overlay over /etc/config/network)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@7643 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/base-files/files/lib/network')
-rwxr-xr-xpackage/base-files/files/lib/network/config.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/package/base-files/files/lib/network/config.sh b/package/base-files/files/lib/network/config.sh
index 8e19a6e996..c6d909fd0a 100755
--- a/package/base-files/files/lib/network/config.sh
+++ b/package/base-files/files/lib/network/config.sh
@@ -74,9 +74,7 @@ prepare_interface() {
# if we're called for the bridge interface itself, don't bother trying
# to create any interfaces here. The scripts have already done that, otherwise
# the bridge interface wouldn't exist.
- [ "br-$config" = "$iface" ] && return 0;
-
- [ -f "$iface" ] && return 0;
+ [ "br-$config" = "$iface" -o -f "$iface" ] && return 0;
ifconfig "$iface" 2>/dev/null >/dev/null && {
# make sure the interface is removed from any existing bridge and brought down
@@ -155,9 +153,11 @@ setup_interface() {
[ -z "$ip6addr" ] || $DEBUG ifconfig "$iface" add "$ip6addr"
[ -z "$gateway" ] || $DEBUG route add default gw "$gateway"
[ -z "$bcast" ] || $DEBUG ifconfig "$iface" broadcast "$bcast"
- [ -z "$dns" -o -f /tmp/resolv.conf.auto ] || {
+ [ -z "$dns" ] || {
for ns in $dns; do
- echo "nameserver $ns" >> /tmp/resolv.conf.auto
+ grep "$ns" /tmp/resolv.conf.auto 2>/dev/null >/dev/null || {
+ echo "nameserver $ns" >> /tmp/resolv.conf.auto
+ }
done
}