small-package/luci-app-eqosplus/luasrc/controller/eqosplus.lua

20 lines
769 B
Lua
Raw Normal View History

2024-02-29 12:20:17 +08:00
module("luci.controller.eqosplus", package.seeall)
-- Copyright 2022-2023 sirpdboy <herboy2008@gmail.com>
function index()
if not nixio.fs.access("/etc/config/eqosplus") then return end
entry({"admin", "control"}, firstchild(), "Control", 44).dependent = false
2024-03-15 20:28:22 +08:00
local e = entry({"admin", "control", "eqosplus"}, cbi("eqosplus"), _("Eqosplus"), 10)
e.dependent=false
e.acl_depends = { "luci-app-eqosplus" }
2024-02-29 12:20:17 +08:00
entry({"admin", "control", "eqosplus", "status"}, call("act_status")).leaf = true
end
function act_status()
local sys = require "luci.sys"
local e = {}
2024-03-15 20:28:22 +08:00
e.status = sys.call(" busybox ps -w | grep eqosplus | grep -v grep >/dev/null ") == 0
2024-02-29 12:20:17 +08:00
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end