Skip to content

Commit

Permalink
Fix Lua
Browse files Browse the repository at this point in the history
  • Loading branch information
Erope committed Dec 26, 2021
1 parent 5136781 commit bd9b818
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions luci-app-nezha/luasrc/controller/nezha-agent.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ end
function act_status()
local e={}
e.running=luci.sys.call("pgrep nezha-agent >/dev/null")==0
e.enabled=luci.sys.exec("uci get nezha-agent.config.enabled")

luci.sys.call("/etc/init.d/nezha-agent enable")
-- e.port=luci.sys.exec("uci get nezha-agent.config.port")
luci.http.prepare_content("application/json")
luci.http.write_json(e)
Expand Down
5 changes: 5 additions & 0 deletions luci-app-nezha/root/etc/init.d/nezha-agent
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,9 @@ start_service() {
procd_set_param limits core="unlimited"
}
procd_close_instance
}

reload_service() {
stop
start
}

0 comments on commit bd9b818

Please sign in to comment.