blob: 7350f57e5d4c96248619add07f8346ce28dfd145 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# 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
|