summaryrefslogtreecommitdiff
path: root/target/linux/brcm47xx/base-files/etc/uci-defaults/03_network_migration
blob: 912fe96224737a836df33fa84938a9bd858b860d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh
#
# Copyright (C) 2014-2015 OpenWrt.org
#

uci show network | grep "\.vlan=0"
[ $? -ne 0 ] && exit 0

logger -t network "network config is invalid, creating new one"

local lan_proto="$(uci -q get network.lan.proto)"
local lan_ipaddr="$(uci -q get network.lan.ipaddr)"
local lan_netmask="$(uci -q get network.lan.netmask)"
local wan_proto="$(uci -q get network.wan.proto)"
local wan_ipaddr="$(uci -q get network.wan.ipaddr)"
local wan_netmask="$(uci -q get network.wan.netmask)"

echo "" > /etc/config/network
config_generate

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