summaryrefslogtreecommitdiffstats
path: root/openntpd-model.lua
diff options
context:
space:
mode:
Diffstat (limited to 'openntpd-model.lua')
-rw-r--r--openntpd-model.lua11
1 files changed, 10 insertions, 1 deletions
diff --git a/openntpd-model.lua b/openntpd-model.lua
index 14aad55..e1bc5d3 100644
--- a/openntpd-model.lua
+++ b/openntpd-model.lua
@@ -80,7 +80,6 @@ local last_time_change = function()
local cmd, error = io.popen("cat /var/log/messages | grep ntpd | grep adjusting | tail -1" ,r)
local cmdoutput1,cmdoutput2 = string.match(cmd:read("*a"), "^%s*(%S+%s+%S+%s+%S+%s+).*: (.*)$")
cmd:close()
--- if not (cmdoutput1) then cmdouput
cmdoutput1 = cmdoutput1 or "(Have no data on updates)"
cmdoutput2 = cmdoutput2 or ""
return cmdoutput1 .. cmdoutput2
@@ -125,6 +124,16 @@ function get ()
return config
end
+function get_logfile ()
+ local me = {}
+ local cmdtxt = "cat /var/log/messages | grep ntpd"
+ local cmd, error = io.popen(cmdtxt ,r)
+ local cmdoutput = cmd:read("*a")
+ cmd:close()
+ me.value = cmdoutput
+ me.cmd = cmdtxt
+ return me
+end
function get_filecontent (self)
local path = ntpdconfig
local file_content = get()