| 1234567891011121314151617181920212223 |
- # SPDX-License-Identifier: GPL-2.0-only
- # Exit if network doesn't contain any swconfig section
- uci -q get network.@switch[0] > /dev/null || exit 0
- lan_proto="$(uci -q get network.lan.proto)"
- lan_ipaddr="$(uci -q get network.lan.ipaddr)"
- lan_netmask="$(uci -q get network.lan.netmask)"
- wan_proto="$(uci -q get network.wan.proto)"
- wan_ipaddr="$(uci -q get network.wan.ipaddr)"
- wan_netmask="$(uci -q get network.wan.netmask)"
- rm /etc/config/network
- config_generate
- uci -q batch <<-EOF
- set network.lan.proto="$lan_proto"
- set network.lan.ipaddr="$lan_ipaddr"
- set network.lan.netmask="$lan_netmask"
- set network.wan.proto="$wan_proto"
- set network.wan.ipaddr="$wan_ipaddr"
- set network.wan.netmask="$wan_netmask"
- EOF
|