mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Disable MLVPN and add setting to force retrieve settings from server
This commit is contained in:
parent
a9656c096e
commit
c7445fe7f9
2 changed files with 23 additions and 7 deletions
|
@ -350,6 +350,7 @@ function wizard_add()
|
|||
ucic:commit("sqm")
|
||||
end
|
||||
|
||||
local force_retrieve = luci.http.formvalue("forceretrieve") or ""
|
||||
-- Retrieve all server settings
|
||||
local serversnb = 0
|
||||
local disablednb = 0
|
||||
|
@ -362,11 +363,10 @@ function wizard_add()
|
|||
local openmptcprouter_vps_key = luci.http.formvalue("%s.openmptcprouter_vps_key" % server) or ""
|
||||
local openmptcprouter_vps_username = luci.http.formvalue("%s.openmptcprouter_vps_username" % server) or ""
|
||||
local openmptcprouter_vps_disabled = luci.http.formvalue("%s.openmptcprouter_vps_disabled" % server) or ""
|
||||
ucic:set("openmptcprouter",server,"server")
|
||||
ucic:set("openmptcprouter",server,"username",openmptcprouter_vps_username)
|
||||
ucic:set("openmptcprouter",server,"password",openmptcprouter_vps_key)
|
||||
if master == server or (master == "" and serversnb == 0) then
|
||||
ucic:set("openmptcprouter",server,"get_config","1")
|
||||
if ucic:get("openmptcprouter",server,"password") == "" or ucic:get("openmptcprouter",server,"password") ~= openmptcprouter_vps_key or ucic:get("openmptcprouter",server,"username") ~= openmptcprouter_vps_username or force_retrieve ~= "" then
|
||||
ucic:set("openmptcprouter",server,"get_config","1")
|
||||
end
|
||||
ucic:set("openmptcprouter",server,"master","1")
|
||||
ucic:set("openmptcprouter",server,"backup","0")
|
||||
else
|
||||
|
@ -380,6 +380,9 @@ function wizard_add()
|
|||
if server_ip ~= "" then
|
||||
serversnb = serversnb + 1
|
||||
end
|
||||
ucic:set("openmptcprouter",server,"server")
|
||||
ucic:set("openmptcprouter",server,"username",openmptcprouter_vps_username)
|
||||
ucic:set("openmptcprouter",server,"password",openmptcprouter_vps_key)
|
||||
ucic:set("openmptcprouter",server,"disabled",openmptcprouter_vps_disabled)
|
||||
ucic:set("openmptcprouter",server,"ip",server_ip)
|
||||
ucic:set("openmptcprouter",server,"port","65500")
|
||||
|
|
|
@ -139,6 +139,19 @@ end
|
|||
</div>
|
||||
</fieldset>
|
||||
<span id="advancedsettings" style="display:none;">
|
||||
<fieldset class="cbi-section" id="serverretrieve">
|
||||
<legend><%:Retrieve settings from server%></legend>
|
||||
<div class="cbi-value">
|
||||
<label class="cbi-value-title"><%:Force retrieve settings%></label>
|
||||
<div class="cbi-value-field">
|
||||
<input class="cbi-input-checkbox" type="checkbox" name="forceretrieve" value="1" />
|
||||
<br />
|
||||
<div class="cbi-value-description">
|
||||
<%:Force retrieve all keys from server.%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset class="cbi-section" id="ipv6">
|
||||
<legend><%:IPv6 settings%></legend>
|
||||
<div class="cbi-value">
|
||||
|
@ -157,7 +170,7 @@ end
|
|||
<input type="text" name="ula" class="cbi-input-text" value="<%=uci:get("network","globals","ula_prefix")%>" />
|
||||
<br />
|
||||
<div class="cbi-value-description">
|
||||
<%:You can set a public IPv6 prefix only if you set only one server.%>
|
||||
<%:You can use a public IPv6 prefix only if you set only one server.%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -278,7 +291,7 @@ end
|
|||
<% elseif vpn == "dsvpn" then %>
|
||||
<% if nixio.fs.access("/usr/sbin/dsvpn") then %><option value="dsvpn" <% if uci:get("dsvpn","vpn","enable") == "1" then %>selected="selected"<% end %>>A Dead Simple VPN</option><% end %>
|
||||
<% elseif vpn == "mlvpn" then %>
|
||||
<% if nixio.fs.access("/usr/sbin/mlvpn") then %><option value="mlvpn" <% if uci:get("mlvpn","general","enable") == "1" then %>selected="selected"<% end %>>MLVPN</option><% end %>
|
||||
<% if nixio.fs.access("/usr/sbin/mlvpn") then %><!--<option value="mlvpn" <% if uci:get("mlvpn","general","enable") == "1" then %>selected="selected"<% end %>>MLVPN</option>--><% end %>
|
||||
<% elseif vpn == "ubond" then %>
|
||||
<% if nixio.fs.access("/usr/sbin/ubond") then %><option value="ubond" <% if uci:get("ubond","general","enable") == "1" then %>selected="selected"<% end %>>UBOND</option><% end %>
|
||||
<% elseif vpn == "openvpn" then %>
|
||||
|
@ -294,7 +307,7 @@ end
|
|||
<% if nixio.fs.access("/usr/sbin/glorytun") then %><option value="glorytun_tcp" <% if uci:get("glorytun","vpn","enable") == "1" and uci:get("glorytun","vpn","proto") == "tcp" then %>selected="selected"<% end %>>Glorytun TCP</option><% end %>
|
||||
<% if nixio.fs.access("/usr/sbin/glorytun-udp") then %><option value="glorytun_udp" <% if uci:get("glorytun","vpn","enable") == "1" and uci:get("glorytun","vpn","proto") == "udp" then %>selected="selected"<% end %>>Glorytun UDP</option><% end %>
|
||||
<% if nixio.fs.access("/usr/sbin/dsvpn") then %><option value="dsvpn" <% if uci:get("dsvpn","vpn","enable") == "1" then %>selected="selected"<% end %>>A Dead Simple VPN</option><% end %>
|
||||
<% if nixio.fs.access("/usr/sbin/mlvpn") then %><option value="mlvpn" <% if uci:get("mlvpn","general","enable") == "1" then %>selected="selected"<% end %>>MLVPN</option><% end %>
|
||||
<% if nixio.fs.access("/usr/sbin/mlvpn") then %><!--<option value="mlvpn" <% if uci:get("mlvpn","general","enable") == "1" then %>selected="selected"<% end %>>MLVPN</option>--><% end %>
|
||||
<% if nixio.fs.access("/usr/sbin/ubond") then %><option value="ubond" <% if uci:get("ubond","general","enable") == "1" then %>selected="selected"<% end %>>UBOND</option><% end %>
|
||||
<% if nixio.fs.access("/usr/sbin/openvpn") then %><option value="openvpn" <% if uci:get("openvpn","omr","enabled") == "1" then %>selected="selected"<% end %>>OpenVPN</option><% end %>
|
||||
<option value="none" <% if uci:get("openmptcprouter","settings","vpn") == "none" then %>selected="selected"<% end %>>None</option>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue