1 # SPDX-License-Identifier: GPL-2.0-only
3 # Exit if network doesn't contain any swconfig section
4 uci -q get network.@switch[0] > /dev/null || exit 0
6 lan_proto="$(uci -q get network.lan.proto)"
7 lan_ipaddr="$(uci -q get network.lan.ipaddr)"
8 lan_netmask="$(uci -q get network.lan.netmask)"
9 wan_proto="$(uci -q get network.wan.proto)"
10 wan_ipaddr="$(uci -q get network.wan.ipaddr)"
11 wan_netmask="$(uci -q get network.wan.netmask)"
13 rm /etc/config/network
17 set network.lan.proto="$lan_proto"
18 set network.lan.ipaddr="$lan_ipaddr"
19 set network.lan.netmask="$lan_netmask"
20 set network.wan.proto="$wan_proto"
21 set network.wan.ipaddr="$wan_ipaddr"
22 set network.wan.netmask="$wan_netmask"