gluon-core: switch LAN and WAN on nanostation-m

This commit is contained in:
Matthias Schiffer 2014-02-28 13:30:18 +01:00
parent a2f699cafd
commit bbd8ee6772

View File

@ -5,14 +5,14 @@
get_primary_mac() { get_primary_mac() {
case "$(ar71xx_board_name)" in case "$(ar71xx_board_name)" in
tl-wdr3600|tl-wdr4300) tl-wdr3600|tl-wdr4300)
cat /sys/class/ieee80211/phy1/macaddress cat /sys/class/ieee80211/phy1/macaddress
;; ;;
*) *)
cat /sys/class/ieee80211/phy0/macaddress cat /sys/class/ieee80211/phy0/macaddress
;; ;;
esac esac
} }
iface_exists() { iface_exists() {
@ -20,8 +20,17 @@ iface_exists() {
ip link show dev "${name//.*/}" >/dev/null 2>&1 ip link show dev "${name//.*/}" >/dev/null 2>&1
} }
lan_ifname="$(uci get network.lan.ifname)" case "$(ar71xx_board_name)" in
wan_ifname="$(uci get network.wan.ifname)" nanostation-m)
# It's more convenient to swap the ports for these devices so WAN is the PoE port
lan_ifname="$(uci get network.wan.ifname)"
wan_ifname="$(uci get network.lan.ifname)"
;;
*)
lan_ifname="$(uci get network.lan.ifname)"
wan_ifname="$(uci get network.wan.ifname)"
;;
esac
if [ -n "$wan_ifname" ] && iface_exists "$wan_ifname"; then if [ -n "$wan_ifname" ] && iface_exists "$wan_ifname"; then
[ -z "$lan_ifname" ] || sysconfig_set lan_ifname "$lan_ifname" [ -z "$lan_ifname" ] || sysconfig_set lan_ifname "$lan_ifname"