diff --git a/OpenWRT/controller/cronosagent.lua b/OpenWRT/controller/cronosagent.lua index d124873..81b65ce 100644 --- a/OpenWRT/controller/cronosagent.lua +++ b/OpenWRT/controller/cronosagent.lua @@ -7,7 +7,6 @@ function index() end function restartCronosAgent() - luci.sys.init.stop("cronosagent") - luci.sys.init.start("cronosagent") + luci.sys.call("/etc/init.d/cronosagent restart") luci.http.write("Done!") end diff --git a/OpenWRT/model/cbi/cronosagent/configure.lua b/OpenWRT/model/cbi/cronosagent/configure.lua index b9056a4..f83fb6c 100644 --- a/OpenWRT/model/cbi/cronosagent/configure.lua +++ b/OpenWRT/model/cbi/cronosagent/configure.lua @@ -1,9 +1,4 @@ -local function handleAferCommit() - luci.sys.init.stop("cronosagent") - luci.sys.init.start("cronosagent") -end - local map = Map("cronosagent", "CronosAgent") local section = map:section(TypedSection, "cronosagent", "Configuration") @@ -19,6 +14,7 @@ server.datatype = "host" password.datatype = "string" password.password = true -map.on_after_commit = handleAferCommit - +function map.on_after_commit(self) + luci.sys.call("/etc/init.d/cronosagent restart") +end return map \ No newline at end of file