treewide: drop shebang from non-executable target files
[openwrt/openwrt.git] / target / linux / bcm47xx / base-files / etc / uci-defaults / 03_network_migration
1 #
2 # Copyright (C) 2014-2015 OpenWrt.org
3 #
4
5 uci show network | grep "\.vlan=0"
6 [ $? -ne 0 ] && exit 0
7
8 logger -t network "network config is invalid, creating new one"
9
10 lan_proto="$(uci -q get network.lan.proto)"
11 lan_ipaddr="$(uci -q get network.lan.ipaddr)"
12 lan_netmask="$(uci -q get network.lan.netmask)"
13 wan_proto="$(uci -q get network.wan.proto)"
14 wan_ipaddr="$(uci -q get network.wan.ipaddr)"
15 wan_netmask="$(uci -q get network.wan.netmask)"
16
17 echo "" > /etc/config/network
18 config_generate
19
20 uci set network.lan.proto=$lan_proto
21 uci set network.lan.ipaddr=$lan_ipaddr
22 uci set network.lan.netmask=$lan_netmask
23 uci set network.wan.proto=$wan_proto
24 uci set network.wan.ipaddr=$wan_ipaddr
25 uci set network.wan.netmask=$wan_netmask
26 uci commit network
27
28 exit 0