bcm53xx: switch to the upstream DSA-based b53 driver
[openwrt/staging/chunkeey.git] / target / linux / bcm53xx / base-files / etc / uci-defaults / 03_dsa_migrate
1 # SPDX-License-Identifier: GPL-2.0-only
2
3 # Exit if network doesn't contain any swconfig section
4 uci -q get network.@switch[0] > /dev/null || exit 0
5
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)"
12
13 rm /etc/config/network
14 config_generate
15
16 uci -q batch <<-EOF
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"
23 EOF