diff options
Diffstat (limited to 'syslog-model.lua')
-rw-r--r-- | syslog-model.lua | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/syslog-model.lua b/syslog-model.lua index 943903a..bc6a333 100644 --- a/syslog-model.lua +++ b/syslog-model.lua @@ -20,8 +20,8 @@ end local writeconfig = function (config) -- Set variables local variable = "SYSLOGD_OPTS" - local variabletranslator = { - logfile = "-O", + local variabletranslator = { + logfile = "-O", loglevel = "-l", smallerlogs = "-S", maxsize = "-s", @@ -41,7 +41,7 @@ local writeconfig = function (config) configdata[entry] = nil end end - + fs.write_file(configfile, format.update_ini_file(fs.read_file(configfile) or "", "", variable, '"'..format.table_to_opts(configdata) .. '"')) end @@ -49,24 +49,24 @@ local makeconfig = function(configcontent) local config = {} configcontent = configcontent or {} -- Next section selects which configurations we should show to the user - config["logfile"] = cfe({ + config["logfile"] = cfe({ label = "Log to given file", descr = "File must be in /var/log directory", value = configcontent["-O"] or "/var/log/messages", }) - config["loglevel"] = cfe({ + config["loglevel"] = cfe({ label = "Set local log level", value = configcontent["-l"] or "8", type = "select", option = getloglevels(), descr = "1=Quiet, ... , " .. table.maxn(getloglevels()) .. "=Debug", }) - config["smallerlogs"] = cfe({ + config["smallerlogs"] = cfe({ label = "Smaller logging output", value = (configcontent["-S"] == ""), type = "boolean", }) - config["maxsize"] = cfe ({ + config["maxsize"] = cfe ({ label = "Max size (KB) before rotate", descr = "Default=200KB, 0=off", value = configcontent["-s"] or "", @@ -76,13 +76,13 @@ local makeconfig = function(configcontent) descr = "Default=1, max=99, 0=purge", value = configcontent["-b"] or "", }) - config["localandnetworklog"] = cfe ({ + config["localandnetworklog"] = cfe ({ label = "Log locally and via network", value = (configcontent["-L"] == ""), type = "boolean", descr = "Default is network only if host[:PORT] is defined", }) - config["remotelogging"] = cfe ({ + config["remotelogging"] = cfe ({ label = "Log to IP or hostname on PORT", descr = "host[:PORT] - Default PORT=514/UDP", value = configcontent["-R"] or "", @@ -146,7 +146,7 @@ end -- PUBLIC FUNCTIONS function mymodule.get_startstop(self, clientdata) - return modelfunctions.get_startstop(processname) + return modelfunctions.get_startstop(processname) end function mymodule.startstop_service(self, startstop, action) |