summaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2009-04-28 23:27:46 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2009-04-28 23:27:46 +0000
commitb613132f2975925f77dad5b644e7ce413a58dd8d (patch)
treed7aad1cf260210ebcfe5bca917da566c67c362e8 /target
parent25bb83b69521cc7082f8132e2d52cc4e48c3002e (diff)
atheros: configure eth1 as wan interface by default, if present
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@15473 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
-rw-r--r--target/linux/atheros/base-files/etc/uci-defaults/network10
1 files changed, 10 insertions, 0 deletions
diff --git a/target/linux/atheros/base-files/etc/uci-defaults/network b/target/linux/atheros/base-files/etc/uci-defaults/network
index 4f6ff6179..68b9a2a27 100644
--- a/target/linux/atheros/base-files/etc/uci-defaults/network
+++ b/target/linux/atheros/base-files/etc/uci-defaults/network
@@ -8,6 +8,7 @@ set network.wan=interface
set network.wan.ifname=eth0.2
set network.wan.proto=dhcp
EOF
+ HAS_SWITCH=1
fi
if [ -e "/sys/bus/mdio_bus/drivers/IC+ IP175C/0:00" ]; then
@@ -24,6 +25,15 @@ set network.eth0_2.device=eth0
set network.eth0_2.vlan=2
set network.eth0_2.ports="4 5t"
EOF
+ HAS_SWITCH=1
fi
+[ -z "$HAS_SWITCH" -a -d /sys/class/net/eth1 ] && {
+ uci batch <<EOF
+set network.wan=interface
+set network.wan.ifname=eth1
+set network.wan.proto=dhcp
+EOF
+}
+
uci commit network