mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-12 18:41:51 +00:00
Fix IPv6 checkbox
This commit is contained in:
parent
0e6de8f068
commit
d61eed5e3c
2 changed files with 6 additions and 8 deletions
|
@ -202,11 +202,7 @@ function wizard_add()
|
|||
ucic:commit("network")
|
||||
|
||||
-- Enable/disable IPv6
|
||||
local disable_ipv6 = "0"
|
||||
local enable_ipv6 = luci.http.formvalue("enableipv6") or "0"
|
||||
if enable_ipv6 == "0" then
|
||||
disable_ipv6 = "1"
|
||||
end
|
||||
local disable_ipv6 = luci.http.formvalue("enableipv6") or "1"
|
||||
set_ipv6_state(disable_ipv6)
|
||||
|
||||
-- Get VPN set by default
|
||||
|
@ -1120,8 +1116,10 @@ end
|
|||
|
||||
function set_ipv6_state(disable_ipv6)
|
||||
-- Disable/Enable IPv6 support
|
||||
luci.sys.exec("sysctl -w net.ipv6.conf.all.disable_ipv6=%s" % disable_ipv6)
|
||||
luci.sys.exec("sed -i 's:^net.ipv6.conf.all.disable_ipv6=[0-9]*:net.ipv6.conf.all.disable_ipv6=%s:' /etc/sysctl.d/zzz_openmptcprouter.conf" % disable_ipv6)
|
||||
--luci.sys.exec("sysctl -qw net.ipv6.conf.all.disable_ipv6=%s" % disable_ipv6)
|
||||
--luci.sys.exec("sed -i 's:^net.ipv6.conf.all.disable_ipv6=[0-9]*:net.ipv6.conf.all.disable_ipv6=%s:' /etc/sysctl.d/zzz_openmptcprouter.conf" % disable_ipv6)
|
||||
luci.sys.exec("sysctl -qw net.ipv6.conf.all.disable_ipv6=0")
|
||||
luci.sys.exec("sed -i 's:^net.ipv6.conf.all.disable_ipv6=[0-9]*:net.ipv6.conf.all.disable_ipv6=0:' /etc/sysctl.d/zzz_openmptcprouter.conf" % disable_ipv6)
|
||||
|
||||
-- Disable/Enable IPv6 for firewall
|
||||
ucic:set("firewall",ucic:get_first("firewall","defaults"),"disable_ipv6",disable_ipv6)
|
||||
|
|
|
@ -110,7 +110,7 @@ end
|
|||
<div class="cbi-value">
|
||||
<label class="cbi-value-title"><%:Enable IPv6%></label>
|
||||
<div class="cbi-value-field">
|
||||
<input class="cbi-input-checkbox" type="checkbox" name="enableipv6" value="1" <% if uci:get("openmptcprouter","settings","disable_ipv6") == 1 then %>checked<% end %> />
|
||||
<input class="cbi-input-checkbox" type="checkbox" name="enableipv6" value="0" <% if uci:get("openmptcprouter","settings","disable_ipv6") == 1 then %>checked<% end %> />
|
||||
<br />
|
||||
<div class="cbi-value-description">
|
||||
<%:You should disable IPv6 here if server doesn't provide IPv6.%>
|
||||
|
|
Loading…
Reference in a new issue