mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Add mptcp check interface
This commit is contained in:
parent
32a67a1756
commit
41bc2d5d2d
2 changed files with 94 additions and 0 deletions
|
@ -16,6 +16,8 @@ function index()
|
|||
entry({"admin", "system", "openmptcprouter", "interfaces_status"}, call("interfaces_status")).leaf = true
|
||||
entry({"admin", "system", "openmptcprouter", "settings"}, template("openmptcprouter/settings"), _("Advanced Settings"), 3).leaf = true
|
||||
entry({"admin", "system", "openmptcprouter", "settings_add"}, post("settings_add")).leaf = true
|
||||
entry({"admin", "system", "openmptcprouter", "mptcp_check"}, template("openmptcprouter/mptcp_check"), _("MPTCP Support Check"), 3).leaf = true
|
||||
entry({"admin", "system", "openmptcprouter", "mptcp_check_trace"}, post("mptcp_check_trace")).leaf = true
|
||||
end
|
||||
|
||||
function wizard_add()
|
||||
|
@ -829,3 +831,25 @@ function _ipv6_discover(interface)
|
|||
end
|
||||
return ra6_result
|
||||
end
|
||||
|
||||
function mptcp_check_trace(interface)
|
||||
luci.http.prepare_content("text/plain")
|
||||
local tracebox
|
||||
local uci = require "luci.model.uci".cursor()
|
||||
local server = uci:get("shadowsocks-libev", "sss0", "server") or ""
|
||||
if server == "" then return end
|
||||
if interface == "" then
|
||||
tracebox = io.popen("tracebox -s /usr/share/tracebox/omr-mptcp-trace.lua " .. server)
|
||||
else
|
||||
tracebox = io.popen("tracebox -s /usr/share/tracebox/omr-mptcp-trace.lua -i " .. interface .. " " .. server)
|
||||
end
|
||||
if tracebox then
|
||||
while true do
|
||||
local ln = tracebox:read("*l")
|
||||
if not ln then break end
|
||||
luci.http.write(ln)
|
||||
luci.http.write("\n")
|
||||
end
|
||||
end
|
||||
return
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue