3 # Copyright (C) 2014 OpenWrt.org
6 uci show network | grep "\.vlan=0"
9 logger -t network "network config is invalid, creating new one"
11 local lan_proto="$(uci -q get network.lan.proto)"
12 local lan_ipaddr="$(uci -q get network.lan.ipaddr)"
13 local lan_netmask="$(uci -q get network.lan.netmask)"
14 local wan_proto="$(uci -q get network.wan.proto)"
15 local wan_ipaddr="$(uci -q get network.wan.ipaddr)"
16 local wan_netmask="$(uci -q get network.wan.netmask)"
18 rm /etc/config/network
19 /etc/init.d/netconfig start
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