mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
fix
This commit is contained in:
parent
06a4f10a4d
commit
1020d095bc
44 changed files with 3520 additions and 31 deletions
39
luci-app-turboacc/luasrc/controller/turboacc.lua
Normal file
39
luci-app-turboacc/luasrc/controller/turboacc.lua
Normal file
|
@ -0,0 +1,39 @@
|
|||
module("luci.controller.turboacc", package.seeall)
|
||||
|
||||
function index()
|
||||
if not nixio.fs.access("/etc/config/turboacc") then
|
||||
return
|
||||
end
|
||||
local page
|
||||
page = entry({"admin", "network", "turboacc"}, cbi("turboacc"), _("Turbo ACC Center"), 1000)
|
||||
page.i18n = "turboacc"
|
||||
page.dependent = true
|
||||
|
||||
entry({"admin", "network", "turboacc", "status"}, call("action_status"))
|
||||
end
|
||||
|
||||
local function fastpath_status()
|
||||
return luci.sys.call("/etc/init.d/turboacc check_status fastpath") == 0
|
||||
end
|
||||
|
||||
local function bbr_status()
|
||||
return luci.sys.call("/etc/init.d/turboacc check_status bbr") == 0
|
||||
end
|
||||
|
||||
local function fullconenat_status()
|
||||
return luci.sys.call("/etc/init.d/turboacc check_status fullconenat") == 0
|
||||
end
|
||||
|
||||
local function dnscaching_status()
|
||||
return luci.sys.call("/etc/init.d/turboacc check_status dns") == 0
|
||||
end
|
||||
|
||||
function action_status()
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json({
|
||||
fastpath_state = fastpath_status(),
|
||||
fullconenat_state = fullconenat_status(),
|
||||
bbr_state = bbr_status(),
|
||||
dnscaching_state = dnscaching_status()
|
||||
})
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue