mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2026-03-14 21:10:11 +01:00
layer2interface: add untagged eth wan device only if it does not already exist
This commit is contained in:
parent
904bddc982
commit
9cc93b9942
1 changed files with 7 additions and 2 deletions
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue