mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-30 20:15:13 +08:00
🌈 Sync 2026-09-24 15:19:50
This commit is contained in:
1 parent
765ac2b267
commit
87101cc7f2
126 files changed
+4403
-2879
No files matched your search
@@ -16,10 +16,14 @@ end
|
||||
function kai_status()
|
||||
local sys = require "luci.sys"
|
||||
local uci = require "luci.model.uci".cursor()
|
||||
local port = tonumber(uci:get_first("kai", "kai", "port")) or 8197
|
||||
if port < 1 or port > 65535 or port % 1 ~= 0 then
|
||||
port = 8197
|
||||
end
|
||||
local status = {
|
||||
running = (sys.call("pidof kai_bin >/dev/null") == 0),
|
||||
port = 8197
|
||||
port = port
|
||||
}
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(status)
|
||||
http.prepare_content("application/json")
|
||||
http.write_json(status)
|
||||
end
|
||||
Reference in new issue
Block a user