atheros: configure eth1 as wan interface by default, if present
authorFelix Fietkau <nbd@openwrt.org>
Tue, 28 Apr 2009 23:27:46 +0000 (23:27 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Tue, 28 Apr 2009 23:27:46 +0000 (23:27 +0000)
SVN-Revision: 15473

target/linux/atheros/base-files/etc/uci-defaults/network

index 4f6ff617900706eaad65923bb16eb2d7d0f09a6e..68b9a2a27dd24ad9d3452b0a834bff633b480842 100644 (file)
@@ -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