mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-08-02 23:49:34 +08:00
25 lines
592 B
Lua
25 lines
592 B
Lua
module("luci.controller.homebox", package.seeall)
|
|
|
|
function index()
|
|
if not nixio.fs.access("/etc/config/homebox") then
|
|
return
|
|
end
|
|
|
|
entry({"admin", "services", "homebox"}, cbi("homebox"), _("Homebox"), 20).dependent = true
|
|
|
|
entry({"admin", "services", "homebox_status"}, call("homebox_status"))
|
|
end
|
|
|
|
function homebox_status()
|
|
local sys = require "luci.sys"
|
|
local uci = require "luci.model.uci".cursor()
|
|
|
|
local status = {
|
|
running = (sys.call("pidof homebox >/dev/null 2>&1") == 0),
|
|
port = 3300
|
|
}
|
|
|
|
luci.http.prepare_content("application/json")
|
|
luci.http.write_json(status)
|
|
end
|