layer2interface: add untagged eth wan device only if it does not already exist

This commit is contained in:
Sukru Senli 2017-12-26 14:22:56 +01:00
parent 904bddc982
commit 9cc93b9942

View file

@ -122,6 +122,13 @@ populate_network_config_ifnames() {
WANPORT="$(db -q get hw.board.ethernetWanPort)"
WANIFACE="${WANPORT}.1"
uci -q get network.wan.ifname >/dev/null || uci -q set network.wan.ifname="$WANIFACE"
ubus call uci get '{"config":"network","type":"device"}' | grep -w name | grep -qw "$WANIFACE" && {
uci -q commit network
return
}
uci -q get network.ethwan >/dev/null || {
uci -q set network.ethwan=device
uci -q set network.ethwan.type=untagged
@ -129,8 +136,6 @@ populate_network_config_ifnames() {
uci -q set network.ethwan.name="$WANIFACE"
}
uci -q get network.wan.ifname || uci -q set network.wan.ifname="$WANIFACE"
uci -q commit network
}