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

24 lines
693 B
Lua
Raw Normal View History

2020-02-01 02:36:42 +08:00
-- This is a free software, use it under GNU General Public License v3.0.
-- Created By [CTCGFW]Project OpenWRT
-- https://github.com/project-openwrt
module("luci.controller.ssocks", package.seeall)
function index()
if not nixio.fs.access("/etc/config/ssocks") then
return
end
local page
2020-09-12 19:18:51 +08:00
page = entry({"admin", "services", "ssocks"}, cbi("ssocks"), _("sSocks Server"), 100)
2020-02-01 02:36:42 +08:00
page.i18n = "ssocks"
page.dependent = true
2020-09-12 19:18:51 +08:00
entry({"admin", "services", "ssocks", "status"},call("act_status")).leaf=true
2020-02-01 02:36:42 +08:00
end
function act_status()
local e={}
e.running=luci.sys.call("ps |grep ssocks |grep -v grep >/dev/null")==0
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end