summaryrefslogtreecommitdiffstats
path: root/syslog-controller.lua
diff options
context:
space:
mode:
Diffstat (limited to 'syslog-controller.lua')
-rw-r--r--syslog-controller.lua25
1 files changed, 13 insertions, 12 deletions
diff --git a/syslog-controller.lua b/syslog-controller.lua
index 77cd0ab..05ed0d3 100644
--- a/syslog-controller.lua
+++ b/syslog-controller.lua
@@ -18,23 +18,18 @@ function status(self)
end
function config(self)
--- local srvcmdresult = nil
--- local srvcmd = self.clientdata.srvcmd
--- if (srvcmd ~= nil) then
--- srvcmdresult = self.model:service_control(srvcmd)
--- if (srvcmd == "stop") or (srvcmd == "restart") then
--- posix.sleep(3) -- Wait for the process to start|stop
--- else
--- posix.sleep(1) -- Wait for the process to start|stop
--- end
--- end
+
+ if ( self.clientdata.cmddaemon) then
+ startstop = self.model:startstop_service( self.clientdata.cmddaemon )
+ end
+
local status = self.model.getstatus()
local config, errors = self.model.getconfig()
local url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller
return {
status = status,
--- srvcmdresult = srvcmdresult,
+ startstop = startstop,
config = config,
errors = errors,
url = url, }
@@ -42,15 +37,21 @@ end
function expert(self)
local modifications = self.clientdata.modifications or ""
- if ( modifications ~= "") then
+ if ( self.clientdata.cmdsave) then
modifications = self.model:update_filecontent(modifications)
end
+ if ( self.clientdata.cmddaemon) then
+ startstop = self.model:startstop_service( self.clientdata.cmddaemon )
+ end
+
local status = self.model.getstatus()
local url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller
return { file = self.model:get_filedetails(),
status = status,
+ startstop = startstop,
+ clientdata = self.clientdata,
url = url, }
end