inteno-netmodes: get wan device from db

This commit is contained in:
Sukru Senli 2018-01-05 21:54:12 +01:00
parent 2f40567ff4
commit 85b0ba1605
2 changed files with 2 additions and 2 deletions

View file

@ -8,7 +8,7 @@ ps | grep hotplug | grep button && exit
MTK=0
[ "$(db -q get hw.board.hardware)" == "EX400" ] && MTK=1
WANDEV="$(uci get layer2_interface_ethernet.Wan.ifname)"
WANDEV="$(db -q get hw.board.ethernetWanPort).1"
[ $MTK -eq 1 ] && WANDEV="eth0.2"
[ "$INTERFACE" != "$WANDEV" ] && exit

View file

@ -7,7 +7,7 @@ if [ $MTK -eq 1 ]; then
WANDEV="eth0.2"
link=$(swconfig dev switch0 port 0 get link | awk '{print$2}' | cut -d':' -f2)
else
WANDEV="$(db -q get hw.board.ethernetWanPort)"
WANDEV="$(db -q get hw.board.ethernetWanPort).1"
link=$(cat /sys/class/net/${WANDEV:0:4}/operstate)
fi