03_dsa_migrate 718 B

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