immortalwrt/package/ctcgfw/luci-app-naiveproxy/luasrc/controller/naiveproxy.lua

24 lines
655 B
Lua
Raw Normal View History

2020-08-25 20:07:41 +08:00
-- This is a free software, use it under GNU General Public License v3.0.
-- Created By ImmortalWrt
-- https://github.com/immortalwrt
2020-08-25 20:07:41 +08:00
module("luci.controller.naiveproxy", package.seeall)
function index()
if not nixio.fs.access("/etc/config/naiveproxy") then
return
end
local page
page = entry({"admin", "services", "naiveproxy"}, cbi("naiveproxy"), _("NaiveProxy"), 100)
page.dependent = true
entry({"admin", "services", "naiveproxy", "status"},call("act_status")).leaf=true
end
function act_status()
local e={}
e.running=luci.sys.call("pgrep naive >/dev/null")==0
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end