summaryrefslogtreecommitdiffstats
path: root/syslog-controller.lua
diff options
context:
space:
mode:
Diffstat (limited to 'syslog-controller.lua')
-rw-r--r--syslog-controller.lua16
1 files changed, 12 insertions, 4 deletions
diff --git a/syslog-controller.lua b/syslog-controller.lua
index 89e41c0..553b765 100644
--- a/syslog-controller.lua
+++ b/syslog-controller.lua
@@ -18,13 +18,19 @@ function status(self)
end
function config(self)
-
+ local cmdresult = {}
+ local cmderrors = {}
if ( self.clientdata.cmddaemon) then
startstop = self.model:startstop_service( self.clientdata.cmddaemon )
end
--- if ( self.clientdata.cmdsave) then
--- modifications = self.model:update_filecontent(modifications)
--- end
+ if ( self.clientdata.cmdsave) then
+ local variables="-O -l -S -s -b -L -R"
+ for var in string.gmatch(variables, "%S+") do
+ -- Send nil instead of "" causes the parameter to be removed/deleted/empty/unset
+ if (self.clientdata[var] == "") then self.clientdata[var] = nil end
+ cmdresult[var],cmderrors[var] = self.model:setconfigs("SYSLOGD_OPTS",var,self.clientdata[var])
+ end
+ end
local status = self.model.getstatus()
local config, errors = self.model.getconfig()
@@ -34,8 +40,10 @@ function config(self)
status = status,
startstop = startstop,
clientdata = self.clientdata,
+ cmdresult = cmdresult,
config = config,
errors = errors,
+ cmderrors = cmderrors,
url = url, }
end