diff options
Diffstat (limited to 'syslog-controller.lua')
-rw-r--r-- | syslog-controller.lua | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/syslog-controller.lua b/syslog-controller.lua index 553b765..b183a89 100644 --- a/syslog-controller.lua +++ b/syslog-controller.lua @@ -24,7 +24,8 @@ function config(self) startstop = self.model:startstop_service( self.clientdata.cmddaemon ) end if ( self.clientdata.cmdsave) then - local variables="-O -l -S -s -b -L -R" + local variables="-O -l -S -s -b -L -R" -- Advanced-config options + --local variables="-R" -- Guided-config options 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 @@ -35,6 +36,18 @@ function config(self) local status = self.model.getstatus() local config, errors = self.model.getconfig() local url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller + + local cmderrors_str = "" + for k,v in pairs(cmderrors) do + if (type(v) ~= "table") then + cmderrors_str = v.. "\n" .. cmderrors_str + else + for kk,vv in pairs(v) do + cmderrors_str = tostring(vv) .. "\n" .. tostring(cmderrors_str) + end + end + end + if (cmderrors_str == "") then cmderrors_str = nil end return { status = status, @@ -43,7 +56,7 @@ function config(self) cmdresult = cmdresult, config = config, errors = errors, - cmderrors = cmderrors, + cmderrors = cmderrors_str, url = url, } end |