2014-07-03 23:40:59 +02:00
|
|
|
#
|
2015-12-11 16:19:43 +01:00
|
|
|
# Copyright (C) 2014-2015 OpenWrt.org
|
2014-07-03 23:40:59 +02:00
|
|
|
#
|
|
|
|
|
|
|
|
uci show network | grep "\.vlan=0"
|
|
|
|
[ $? -ne 0 ] && exit 0
|
|
|
|
|
|
|
|
logger -t network "network config is invalid, creating new one"
|
|
|
|
|
2016-09-24 14:30:24 +02:00
|
|
|
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)"
|
2014-07-03 23:40:59 +02:00
|
|
|
|
2015-12-11 16:19:43 +01:00
|
|
|
echo "" > /etc/config/network
|
|
|
|
config_generate
|
2014-07-03 23:40:59 +02:00
|
|
|
|
|
|
|
uci set network.lan.proto=$lan_proto
|
|
|
|
uci set network.lan.ipaddr=$lan_ipaddr
|
|
|
|
uci set network.lan.netmask=$lan_netmask
|
|
|
|
uci set network.wan.proto=$wan_proto
|
|
|
|
uci set network.wan.ipaddr=$wan_ipaddr
|
|
|
|
uci set network.wan.netmask=$wan_netmask
|
|
|
|
uci commit network
|
|
|
|
|
|
|
|
exit 0
|