From 4d0dd5634b70d13902ec50655047307eb7a4b020 Mon Sep 17 00:00:00 2001 From: Robin Stjerndorff Date: Wed, 17 Oct 2018 15:56:15 +0200 Subject: [PATCH] fix ubus representation for EX400 topology in cloud refs: #15754 --- netmode/files/lib/functions/netmode.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/netmode/files/lib/functions/netmode.sh b/netmode/files/lib/functions/netmode.sh index 77e64cf4e..cc6d6aaf6 100644 --- a/netmode/files/lib/functions/netmode.sh +++ b/netmode/files/lib/functions/netmode.sh @@ -91,8 +91,13 @@ correct_uplink() { wetcfg="$(get_wifi_iface_cfgstr $WETIF)" wetnet="$(uci -q get $wetcfg.network)" wetmac="$(ifconfig $WETIF | grep HWaddr | awk '{print$NF}')" + ethwanmac="$(ifconfig $WANDEV | grep HWaddr | awk '{print$NF}')" if [ -d /sys/class/net/br-$wetnet ]; then - ifconfig br-$wetnet hw ether $wetmac + if [ "$link" == "up" ]; then + ifconfig br-$wetnet hw ether $ethwanmac + else + ifconfig br-$wetnet hw ether $wetmac + fi #touch -f /tmp/netmodes/uplink-macaddr-corrected fi fi