forked from freifunk-franken/firmware
Allow setting WAN vlan/interface from gateway config. A configuration without explicit definition of a WAN interface is valid at the moment and results in the default configuration from fff-network being used. Originally, it was intended to automatically set WAN to vlan 2, if nothing was specified. As this would break devices, which don't use swconfig for WAN, the already configured WAN interface is left untouched. Fixes: #85 (gitea) Signed-off-by: Fabian Bläse <fabian@blaese.de> Reviewed-by: Christian Dresel <freifunk@dresel.systems> Reviewed-by: Robert Langhammer <rlanghammer@web.de>
22 lines
474 B
Plaintext
22 lines
474 B
Plaintext
# load board specific properties
|
|
BOARD="$(uci get board.model.name)"
|
|
. /etc/network.$BOARD
|
|
|
|
configure() {
|
|
if vlan=$(uci -q get gateway.@wan[0].vlan); then
|
|
uci set network.wan.ifname="${SWITCHDEV}.$vlan"
|
|
elif iface=$(uci -q get gateway.@wan[0].iface); then
|
|
uci set network.wan.ifname="$iface"
|
|
else
|
|
echo "WARNING: No vlan/interface for WAN specified. The default setting won't be overwritten."
|
|
fi
|
|
}
|
|
|
|
apply() {
|
|
uci commit network
|
|
}
|
|
|
|
revert() {
|
|
uci revert network
|
|
}
|