From c1bf1823f2eb60f741e0c9312b20f080874fb315 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Wed, 1 Mar 2017 01:24:12 +0000 Subject: Add logfile action --- openssh-model.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'openssh-model.lua') diff --git a/openssh-model.lua b/openssh-model.lua index acd89fd..f460c0e 100644 --- a/openssh-model.lua +++ b/openssh-model.lua @@ -334,4 +334,18 @@ function mymodule.create_auth(self, authstr) return authstr end +function mymodule.get_logfile(self, clientdata) + local retval = cfe({ type="group", value={}, label="Log File Configuration" }) + retval.value.facility = cfe({value="auth", label="Syslog Facility"}) + retval.value.grep = cfe({ value="sshd", label="Grep" }) + + local config = format.parse_configfile(fs.read_file(configfile) or "") + if config then + if config.SyslogFacility then + retval.value.facility.value = config.SyslogFacility:lower() + end + end + return retval +end + return mymodule -- cgit v1.2.3