3 # Copyright (C) 2014-2015 OpenWrt.org
6 uci show network | grep "\.vlan=0"
9 logger -t network "network config is invalid, creating new one"
11 lan_proto="$(uci -q get network.lan.proto)"
12 lan_ipaddr="$(uci -q get network.lan.ipaddr)"
13 lan_netmask="$(uci -q get network.lan.netmask)"
14 wan_proto="$(uci -q get network.wan.proto)"
15 wan_ipaddr="$(uci -q get network.wan.ipaddr)"
16 wan_netmask="$(uci -q get network.wan.netmask)"
18 echo "" > /etc/config/network
21 uci set network.lan.proto=$lan_proto
22 uci set network.lan.ipaddr=$lan_ipaddr
23 uci set network.lan.netmask=$lan_netmask
24 uci set network.wan.proto=$wan_proto
25 uci set network.wan.ipaddr=$wan_ipaddr
26 uci set network.wan.netmask=$wan_netmask