Skip to content

Commit 323e270

Browse files
committed
improve MST firmware network file setup #1092
1 parent 6868047 commit 323e270

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

decompressed/gui_file/etc/modgui_scripts/06_network.sh

+7-9
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ setup_network() {
3939
uci -q set network.waneth4.name=waneth4
4040
uci -q set network.waneth4.vid=835
4141
fi
42-
if [ ! "$(uci -q get network.waneth4.vid)" ]; then
43-
uci -q set network.waneth4.vid=835
44-
fi
42+
[ ! "$(uci -q get network.waneth4.vid)" ] && uci -q set network.waneth4.vid=835
4543

4644
#Set a wanptm0 interface if not found (fix wizard on UNO)
4745
if [ ! "$(uci -q get network.wanptm0)" ]; then
@@ -51,10 +49,12 @@ setup_network() {
5149
uci -q set network.wanptm0.type=8021q
5250
uci -q set network.wanptm0.name=wanptm0
5351
uci -q set network.wanptm0.vid=835
52+
53+
#workaround to avoid who already setup the MST device vlan_wan on VLAN 835
54+
[ "$(uci -q get network.vlan_wan.vid)" == "835" ] && uci -q set network.wanptm0.vid=836
5455
fi
55-
if [ ! "$(uci -q get network.wanptm0.vid)" ]; then
56-
uci -q set network.wanptm0.vid=835
57-
fi
56+
[ ! "$(uci -q get network.wanptm0.vid)" ] && uci -q set network.wanptm0.vid=835
57+
[ ! "$(uci -q get network.wanptm0.ifname)" ] && uci -q set network.wanptm0.ifname=ptm0
5858

5959
#Set a SSH_wan firewall rule if not found (fix SSH Wan not working)
6060
if [ ! "$(uci -q get firewall.SSH_wan)" ]; then
@@ -81,9 +81,7 @@ setup_network() {
8181
fi
8282

8383
#Set missing wan path (Telstra)
84-
if [ ! "$(uci -q get network.wan.auto)" ]; then
85-
uci set network.wan.auto='1'
86-
fi
84+
[ ! "$(uci -q get network.wan.auto)" ] && uci set network.wan.auto='1'
8785

8886
if [ ! "$(uci get -q network.config.wan_mode)" ]; then
8987
uci set network.config="config"

0 commit comments

Comments
 (0)