1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Little changes in wizard

This commit is contained in:
Ycarus 2018-06-22 10:00:46 +02:00
parent 0f524f175b
commit dfbba31e1d
2 changed files with 10 additions and 2 deletions

View file

@ -23,11 +23,15 @@ function wizard_add()
local gostatus = true
if add_interface ~= "" then
local i = 1
local multipath_master = false
ucic:foreach("network", "interface", function(s)
local sectionname = s[".name"]
if sectionname:match("^wan(%d+)$") then
i = i + 1
end
if uci:get("network",sectionname,"multipath") == "master" then
multipath_master = true
end
end)
local defif = ucic:get("network","wan1","ifname") or "eth0"
ucic:set("network","wan" .. i,"interface")
@ -35,7 +39,11 @@ function wizard_add()
ucic:set("network","wan" .. i,"proto","static")
ucic:set("network","wan" .. i,"type","macvlan")
ucic:set("network","wan" .. i,"ip4table","wan")
ucic:set("network","wan" .. i,"multipath","on")
if multipath_master then
ucic:set("network","wan" .. i,"multipath","on")
else
ucic:set("network","wan" .. i,"multipath","master")
end
ucic:set("network","wan" .. i,"defaultroute","0")
ucic:save("network")
ucic:commit("network")

View file

@ -21,7 +21,7 @@
<br />
<div class="cbi-value-description">
<span class="cbi-value-helpicon"><img src="/luci-static/resources/cbi/help.gif" alt="help" /></span>
<%:Server IP will be set for ShadowSocks, Glorytun and MLVPN%>
<%:Server IP will be set for ShadowSocks, Glorytun, OpenVPN and MLVPN%>
</div>
</div>
</div>