summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--openntpd-advanced-html.lsp2
-rw-r--r--openntpd-controller.lua4
-rw-r--r--openntpd-model.lua11
4 files changed, 17 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 404f7c7..1fea7a0 100644
--- a/Makefile
+++ b/Makefile
@@ -5,8 +5,10 @@ VERSION=1.0_alpha1
APP_DIST=\
openntpd-advanced-html.lsp \
openntpd-controller.lua \
+openntpd-logfile-html.lsp \
openntpd-model.lua \
openntpd-read-html.lsp \
+openntpd-settings-html.lsp \
openntpd.menu
diff --git a/openntpd-advanced-html.lsp b/openntpd-advanced-html.lsp
index 33f59e5..4c0254e 100644
--- a/openntpd-advanced-html.lsp
+++ b/openntpd-advanced-html.lsp
@@ -35,7 +35,7 @@
<input type="submit" name="cmd" value="update"></form>
<?
---[[ DEBUG INFORMATION
+---[[ DEBUG INFORMATION
require("debugs")
io.write(debugs.variables(view))
--]]
diff --git a/openntpd-controller.lua b/openntpd-controller.lua
index 8b1fe04..9e520c6 100644
--- a/openntpd-controller.lua
+++ b/openntpd-controller.lua
@@ -31,6 +31,10 @@ settings = function (self)
end
end
+logfile = function (self)
+ return ( {logfile = self.model:get_logfile(), url = url } )
+end
+
read = function (self)
local cmd = self.clientdata.cmd
local url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller
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()