4
Fork 0
CronosAgent/OpenWRT/controller/cronosagent.lua

14 lines
601 B
Lua

module("luci.controller.cronosagent", package.seeall)
function index()
entry({ "admin", "cronosagent" }, alias("admin", "cronosagent", "configure", "restart"), "CronosAgent")
entry({ "admin", "cronosagent", "configure" }, cbi("cronosagent/configure"), "Configure", 10)
entry({ "admin", "cronosagent", "restart" }, call("restartCronosAgent"), "Restart", 20)
end
function restartCronosAgent()
luci.sys.init.stop("cronosagent")
luci.sys.init.start("cronosagent")
luci.http.write("Done!")
-- luci.http.redirect("/")
end