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

Small changes on text in status page

This commit is contained in:
Ycarus (Yannick Chabanois) 2019-07-15 22:36:24 +02:00
parent 0e871b0ac6
commit 129bb12930
4 changed files with 34 additions and 8 deletions

View file

@ -536,6 +536,12 @@ function settings_add()
-- Set tcp_fastopen
local tcp_fastopen = luci.http.formvalue("tcp_fastopen")
local fastopen = luci.http.formvalue("disablefastopen") or "0"
if fastopen == "0" then
tcp_fastopen = "0"
elseif tcp_fastopen == "0" and fastopen == "1" then
tcp_fastopen = "3"
end
luci.sys.exec("sysctl -w net.ipv4.tcp_fastopen=%s" % tcp_fastopen)
luci.sys.exec("sed -i 's:^net.ipv4.tcp_fastopen=[0-3]*:net.ipv4.tcp_fastopen=%s:' /etc/sysctl.d/zzz_openmptcprouter.conf" % tcp_fastopen)
@ -548,6 +554,16 @@ function settings_add()
ucic:set("openmptcprouter","settings","external_check",externalcheck)
ucic:commit("openmptcprouter")
-- Enable/disable fast open
local fastopen = luci.http.formvalue("disablefastopen") or "0"
ucic:foreach("shadowsocks-libev", "ss_redir", function (section)
ucic:set("shadowsocks-libev",section[".name"],"fast_open",fastopen)
end)
ucic:foreach("shadowsocks-libev", "ss_local", function (section)
ucic:set("shadowsocks-libev",section[".name"],"fast_open",fastopen)
end)
-- Enable/disable obfs
local obfs = luci.http.formvalue("obfs") or "0"
local obfs_plugin = luci.http.formvalue("obfs_plugin") or "v2ray"