OpenWrt – Blame information for rev 4
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
4 | office | 1 | #!/bin/sh |
2 | # |
||
3 | # Copyright (C) 2014-2015 OpenWrt.org |
||
4 | # |
||
5 | |||
6 | uci show network | grep "\.vlan=0" |
||
7 | [ $? -ne 0 ] && exit 0 |
||
8 | |||
9 | logger -t network "network config is invalid, creating new one" |
||
10 | |||
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)" |
||
17 | |||
18 | echo "" > /etc/config/network |
||
19 | config_generate |
||
20 | |||
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 |
||
27 | uci commit network |
||
28 | |||
29 | exit 0 |