Skip to content

Commit

Permalink
check linux version to enable fast open option.
Browse files Browse the repository at this point in the history
  • Loading branch information
simonchen committed Feb 16, 2023
1 parent ef4f58c commit b521bde
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion trunk/user/shadowsocks/ss/genssconfig.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ local server = cjson.decode(servertmp)
if server.plugin == "simple-obfs" then
server.plugin = "obfs-local"
end
local fast_open = false
local f = io.popen("uname -r | awk -F '.' '{print $1\".\"$2;}'") -- runs command
local v = f:read("*a") -- read linux version
if tonumber(v) > 3.7 then
fast_open = true
end

local ss = {
server = server.server,
server_port = server.server_port,
Expand All @@ -20,7 +27,7 @@ local ss = {
plugin = server.plugin,
plugin_opts = server.plugin_opts,
reuse_port = true,
fast_open = false
fast_open = fast_open
}

print(cjson.encode(ss))

0 comments on commit b521bde

Please sign in to comment.