summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--openntpd-config-html.lsp102
-rw-r--r--openntpd-controller.lua59
-rw-r--r--openntpd-expert-html.lsp83
-rw-r--r--openntpd-logfile-html.lsp20
-rw-r--r--openntpd-model.lua160
-rw-r--r--openntpd-status-html.lsp18
6 files changed, 203 insertions, 239 deletions
diff --git a/openntpd-config-html.lsp b/openntpd-config-html.lsp
index b389ad6..34c7b0d 100644
--- a/openntpd-config-html.lsp
+++ b/openntpd-config-html.lsp
@@ -1,95 +1,127 @@
<? local view = ... ?>
-<h1>CONFIGURATION</h1>
-
-<H2>Enable/Disable</H2>
-<DT>Change status for this program</DT>
-<DD><input class="radio" type="radio" name="enabled" value="2" <? if (view.status.enabled) then io.write('checked') end ?> >Enable
-<input class="radio" type="radio" name="enabled" value="3" <? if not (view.status.enabled) then io.write('checked') end ?> >Disable</DD>
-
-<H2>Guided config</H2>
-<H3>General settings</H3>
+<h1>SYSTEM INFO</h1>
-<? --[[ ?>
-<h1>System time</h1>
+<dl>
+<dt>Program status
+<dd><? if (view.status.enabled) then io.write('Enabled') else io.write('Disabled') end ?></dd>
+</dl>
-<h2>SYSTEM INFO</h2>
+<dl>
+<dt>Program version</dt>
+<dd><?= view.status.version ?></dd>
+</dl>
-<dt>Process status</dt>
-<dd><? io.write(view.status.status) ?><? if (view.startstop.status) then io.write(" (" .. view.startstop.status .. ")") end ?></dd>
-
-<dt>Start or stop process</dt>
-<dd><form name="start" action="" method="POST">
-<input type=submit class="submit" name="cmd" value="start"></form>
-<form name="stop" action="" method="POST">
-<input type=submit class="submit" name="cmd" value="stop"></form></dd>
+<h1>CONFIGURATION</h1>
-<? --]] ?>
+<H2>Advanced config</H2>
+<H3>General settings</H3>
<form name="cmd" action="" method="POST">
+<dl>
<dt>Set time immediately at startup</dt>
<dd><input type="checkbox" name="settings_startup" <? if (view.status.setstimeonstartup) then io.write("checked") end ?>></dd>
+</dl>
+<dl>
<dt>Save the above settings</dt>
-<dd><input name="settings_cmd" class="submit" type="submit" value="Save"> (see above)</dd>
+<dd><input name="settings_cmd" class="submit" type="submit" value="Save"> (see above)
+</dd>
+
+</dl>
</form>
<h3>'SET TIME' OPTIONS</h3>
<form name="cmd" action="" method="POST">
+
+<dl>
<dt>Timeserver hosts...</dt>
<dd>
<select name="hosts_list" size="3">
-<? if (view.status.servers) then
-for i = 1, table.maxn(view.status.servers) do ?>
- <option value="servers <? io.write(view.status.servers[i].value) ?>"><? io.write(view.status.servers[i].value) ?> (pool)</option>
+<? if (view.config.variables.servers) then
+for i = 1, table.maxn(view.config.variables.servers) do ?>
+ <option value="servers <? io.write(view.config.variables.servers[i].value) ?>"><? io.write(view.config.variables.servers[i].value) ?> (pool)</option>
<? end end ?>
-<? if (view.status.server) then
-for i = 1, table.maxn(view.status.server) do ?>
- <option value="server <? io.write(view.status.server[i].value) ?>"><? io.write(view.status.server[i].value) ?></option>
+<? if (view.config.variables.server) then
+for i = 1, table.maxn(view.config.variables.server) do ?>
+ <option value="server <? io.write(view.config.variables.server[i].value) ?>"><? io.write(view.config.variables.server[i].value) ?></option>
<? end end ?>
</select><BR>
In most cases you could use <i><b>pool.ntp.org</b></i> or <i><b>[countryname].pool.ntp.org</i></b> (if listed in <i><b>http://www.pool.ntp.org/</b></i>).
<? if (view.errors.hosts_list) then io.write("<p class=error>"..view.errors.hosts_list.."</p>") end ?></dd>
+</dl>
+<dl>
<dt>Delete selected host</dt>
<dd><input name="hosts_cmd" class="submit" type="submit" value="Delete"> (see above)</dd>
+</dl>
-<dt>Host to add</dt>
-<dd><input type="text" name="hosts_add" class="text" value=""><? if (view.errors.hosts_add) then io.write("<p class=error>"..view.errors.hosts_add.."</p>") end ?></dd>
+<dl>
+<dt <? if (view.errors.hosts_add) then io.write("class=error") end ?>>Host to add</dt>
+<dd><input type="text" name="hosts_add" class="text" value="<?= view.errors.hosts_add_orgvalue or "" ?>"><? if (view.errors.hosts_add) then io.write("<p class=error>"..view.errors.hosts_add.."</p>") end ?></dd>
+</dl>
+
+<dl <? if (view.errors.hosts_type) then io.write("class=error") end ?>>
<dt>Type of above server</dt>
-<dd><span style="display:inline">Single server:<input type="radio" name="hosts_type" value="server"> Server pool:<input type="radio" name="hosts_type" value="servers"></span></dd>
+<dd><span style="display:inline">Single server:<input type="radio" name="hosts_type" value="server"> Server pool:<input type="radio" name="hosts_type" value="servers"></span><? if (view.errors.hosts_type) then io.write("<p class=error>"..view.errors.hosts_type.."</p>") end ?></dd>
+</dl>
+<dl>
<dt>Add new host</dt>
<dd><input name="hosts_cmd" class="submit"type="submit" value="Add"></dd>
+</dl>
</form>
<h3>'PRESENT TIME' OPTIONS (ACT AS TIME SERVER)</h3>
<form name="cmd" action="" method="POST">
+<dl>
<dt>Listen on address...</dt>
<dd>
<select name="listen_list" size="3">
-<? if (view.status.listen) then
-for i = 1, table.maxn(view.status.listen) do ?>
- <option value="listen on <? io.write(view.status.listen[i].value) ?>"><? io.write(view.status.listen[i].value) ?></option>
+<? if (view.config.variables.listen) then
+for i = 1, table.maxn(view.config.variables.listen) do ?>
+ <option value="listen on <? io.write(view.config.variables.listen[i].value) ?>"><? io.write(view.config.variables.listen[i].value) ?></option>
<? end end ?>
</select><BR>Empty list = Listening (acting as server) is disabled<br>"*" = Listen on all local addresses
<? if (view.errors.listen_list) then io.write("<p class=error>"..view.errors.listen_list.."</p>") end ?>
</dd>
+</dl>
+<dl>
<dt>Delete selected address</dt>
<dd><input name="listen_cmd" type="submit" class="submit" value="Delete"> (see above)</dd>
+</dl>
+<dl>
<dt>Add new listen address</dt>
<dd><input name="listen_add" type="text" class="text" value=""> <input name="listen_cmd" type="submit" class="submit" value="Add"><? if (view.errors.listen_add) then io.write("<p class=error>"..view.errors.listen_add.."</p>") end ?></dd>
+</dl>
</form>
+<H1>MANAGEMENT</H1>
+
+<dl>
+<dt>Program controll-panel</dt>
+<dd><form name="cmd" action="" method="POST">
+<input type=submit class="submit" name="cmd" value="start">
+<input type=submit class="submit" name="cmd" value="stop">
+<input type=submit class="submit" name="cmd" value="restart">
+</form></dd>
+</dl>
+
+<? if (view.startstop) and (view.startstop.cmdresult) then ?>
+<dl>
+<dt>Previous action result</dt>
+<dd><pre><?= view.startstop.cmdresult?></pre></dd>
+</dl>
+<? end ?>
+
<?
--[[ DEBUG INFORMATION
require("debugs")
io.write(debugs.variables(view))
--]]
?>
-
diff --git a/openntpd-controller.lua b/openntpd-controller.lua
index b7d8c8e..7031263 100644
--- a/openntpd-controller.lua
+++ b/openntpd-controller.lua
@@ -45,6 +45,7 @@ config = function (self)
end
if (self.clientdata.hosts_type == nil) then
errors["hosts_type"]="You need to choose type of server"
+ errors["hosts_add_orgvalue"] = self.clientdata.hosts_add
end
if (self.clientdata.hosts_add ~= "") and (self.clientdata.hosts_type ~= nil) then
modify_opts = self.model:modify_config(hosts_cmd, nil, self.clientdata.hosts_type .. " " .. self.clientdata.hosts_add)
@@ -73,58 +74,44 @@ config = function (self)
DEBUGMODEL = modify_opts -- <<< DEBUG INFO >>>
DEBUGCLIENTDATA = self.clientdata -- <<< DEBUG INFO >>>
+ local startstop
if ( cmd ~= nil ) then
- local startstop = self.model:startstop_service( cmd )
- posix.sleep(1) -- Wait for the process to start|stop
- return ( {status = self.model:get(),
- startstop = "",
- modify_opts=modify_opts,
- url = url } )
- else
- return ( {status = self.model:get(), startstop = "",
- errors = errors,
- modify_opts=modify_opts,
- url = url,
- DEBUGMODEL=DEBUGMODEL,
- DEBUGCLIENTDATA=DEBUGCLIENTDATA } )
+ startstop = self.model:startstop_service( cmd )
end
+ return ( {status = self.model:getstatus(),
+ config = self.model:getconfig(),
+ url = url,
+ errors = errors,
+ startstop = startstop, } )
end
logfile = function (self)
- return ( {logfile = self.model:get_logfile(), url = url } )
+ return ( {status = self.model:getstatus(), logfile = self.model:get_logfile(), url = url } )
end
status = function (self)
local cmd = self.clientdata.cmd
local url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller
- return ( {status = self.model:get(), url = url } )
+ return ( {status = self.model:getstatus(), url = url } )
end
expert = function (self)
- local file = self.clientdata.modifications or ""
+ local modifications = self.clientdata.modifications or ""
local cmd = self.clientdata.cmd
local url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller
- if ( file ~= "") then
- local me = ( {file = self.model:update_filecontent(file), url = url } )
- return ( {startstop = "",
- status = self.model:get(),
- file = self.model:get_filecontent(),
- url = url } )
- else
- if ( cmd ~= nil ) then
- local startstop = self.model:startstop_service( cmd )
- posix.sleep(1) -- Wait for the process to start|stop
- return ( {startstop = startstop,
- status = self.model:get(),
- filec = self.model:get_filecontent(),
- url = url } )
- else
- return ( {startstop = "",
- status = self.model:get(),
- file = self.model:get_filecontent(),
- url = url } )
- end
+ if ( modifications ~= "") then
+ modifications = self.model:update_filecontent(modifications)
+ end
+
+ if ( cmd ~= nil ) then
+ startstop = self.model:startstop_service( cmd )
end
+
+ return ( {startstop = startstop,
+ status = self.model:getstatus(),
+ file = self.model:get_filedetails(),
+ modifications = modifications,
+ url = url, } )
end
diff --git a/openntpd-expert-html.lsp b/openntpd-expert-html.lsp
index c74b30d..4ccce68 100644
--- a/openntpd-expert-html.lsp
+++ b/openntpd-expert-html.lsp
@@ -1,17 +1,18 @@
<? local view = ... ?>
-<?
---[[ DEBUG INFORMATION
-require("debugs")
-io.write(debugs.variables(view))
---]]
-?>
-<h1>CONFIGURATION</h1>
+<h1>SYSTEM INFO</h1>
+
+<dl>
+<dt>Program status
+<dd><? if (view.status.enabled) then io.write('Enabled') else io.write('Disabled') end ?></dd>
+</dl>
-<H2>Enable/Disable</H2>
-<DT>Change status for this program</DT>
-<DD><input class="radio" type="radio" name="enabled" value="2" <? if (view.status.enabled) then io.write('checked') end ?> >Enable
-<input class="radio" type="radio" name="enabled" value="3" <? if not (view.status.enabled) then io.write('checked') end ?> >Disable</DD>
+<dl>
+<dt>Program version</dt>
+<dd><?= view.status.version ?></dd>
+</dl>
+
+<h1>CONFIGURATION</h1>
<H2>Expert config</H2>
@@ -24,7 +25,7 @@ io.write(debugs.variables(view))
<dd><?= view.file.details.size ?></dd>
<dt>Last modified</dt>
-<dd><?= view.file.details.mtimelong ?></dd>
+<dd><?= view.file.details.mtime ?></dd>
<h3>File content</h3>
@@ -35,43 +36,29 @@ io.write(debugs.variables(view))
<H2>Save and apply above settings</H2>
<DT>Apply settings</DT>
<DD><input class="submit" type="submit" value="Apply"/></DD>
-</form>
-
-<? --[[ ?>
-
-<h1>System time</h1>
-
-<h2>SYSTEM INFO</h2>
-
-<dt>Process status</dt>
-<dd><? io.write(view.statusinfo.status) ?><? if (view.startstop.status) then io.write(" (" .. view.startstop.status .. ")") end ?></dd>
-
-<dt>Start or stop process</dt>
-<dd><form name="start" action="" method="POST"><input type=submit name="cmd" class="submit" value="start"></form><form name="stop" action="" method="POST"><input type=submit name="cmd" class="submit" value="stop"></form></dd>
-
-<h2>Details</h2>
-<dt>File name</dt>
-<dd><?= view.filecontent.filedetails.longname ?></dd>
-
-<dt>File size</dt>
-<dd><?= view.filecontent.filedetails.size ?></dd>
-
-<dt>Last modified</dt>
-<dd><?= view.filecontent.filedetails.mtimelong ?></dd>
-
-<? if (view.statusinfo.errtxt) then ?>
-<dt>Error message</dt>
-<dd class="error"><?= view.statusinfo.errtxt ?></dd>
+<H1>MANAGEMENT</H1>
+
+<dl>
+<dt>Program controll-panel</dt>
+<dd><form name="cmd" action="" method="POST">
+<input type=submit class="submit" name="cmd" value="start">
+<input type=submit class="submit" name="cmd" value="stop">
+<input type=submit class="submit" name="cmd" value="restart">
+</form></dd>
+</dl>
+
+<? if (view.startstop) and (view.startstop.cmdresult) then ?>
+<dl>
+<dt>Previous action result</dt>
+<dd><pre><?= view.startstop.cmdresult?></pre></dd>
+</dl>
<? end ?>
-<h2>Content</h2>
-<form name="myform" action="" method="POST">
-<input name="name" type=hidden value="<?= view.filecontent.filedetails.longname ?>">
-<textarea name="modifications"><?= view.filecontent.value ?></textarea>
-
-<input type="submit" name="cmd" class="submit" value="update"></form>
-
-<? --]] ?>
-
+<?
+--[[ DEBUG INFORMATION
+require("debugs")
+io.write(debugs.variables(view))
+--]]
+?>
diff --git a/openntpd-logfile-html.lsp b/openntpd-logfile-html.lsp
index 593a8d1..41c7f95 100644
--- a/openntpd-logfile-html.lsp
+++ b/openntpd-logfile-html.lsp
@@ -1,17 +1,29 @@
<? local view = ... ?>
-<html>
-<body>
+
+<h1>SYSTEM INFO</h1>
+
+<dl>
+<dt>Program status
+<dd><? if (view.status.enabled) then io.write('Enabled') else io.write('Disabled') end ?></dd>
+</dl>
+
+<dl>
+<dt>Program version</dt>
+<dd><?= view.status.version ?></dd>
+</dl>
+
+
<h1>LOGFILE</h1>
<h2>Details</h2>
+<dl>
<dt>Logfile</dt>
<dd><?= view.logfile.cmd ?></dd>
+</dl>
<h2>Content</h2>
<textarea name=""><? io.write(view.logfile.value) ?></textarea>
-</body>
-</html>
<?
--[[ DEBUG INFORMATION
diff --git a/openntpd-model.lua b/openntpd-model.lua
index 4960534..ff7c470 100644
--- a/openntpd-model.lua
+++ b/openntpd-model.lua
@@ -1,14 +1,21 @@
module (..., package.seeall)
+--require("date")
+--require("posix")
require("format")
-require("date")
require("fs")
-require("posix")
+require("procps")
+require("getopts")
+require("daemoncontrol")
-local ntpdconfig = "/etc/ntpd.conf"
-local ntpdconfd = "/etc/conf.d/ntpd"
-local progname = "openntpd"
+local configfile = "/etc/ntpd.conf"
+local confdfile = "/etc/conf.d/ntpd"
+local processname = "openntpd"
+-- ################################################################################
+-- LOCAL FUNCTIONS
+
+-- This function is used to get config_content.
local function config_content( f )
local config = {}
config.name = f
@@ -33,28 +40,6 @@ local function config_content( f )
return config
end
-local function file_info ( path )
- require("posix")
- local filedetails = posix.stat(path)
- filedetails["owner"]=rawget((posix.getpasswd(filedetails["uid"])),"name")
- filedetails["group"]=rawget((posix.getgroup(filedetails["gid"])),"name")
- filedetails["atimelong"]=os.date("%c", filedetails["atime"])
- filedetails["mtimelong"]=os.date("%c", filedetails["mtime"])
- filedetails["path"]=path
- filedetails["name"]=basename(path)
-
- if ( filedetails["size"] > 1073741824 ) then
- filedetails["size"]=((filedetails["size"]/1073741824) - (filedetails["size"]/1073741824%0.1)) .. "G"
- elseif ( filedetails["size"] > 1048576 ) then
- filedetails["size"]=((filedetails["size"]/1048576) - (filedetails["size"]/1048576%0.1)) .. "M"
- elseif ( filedetails["size"] > 1024 ) then
- filedetails["size"]=((filedetails["size"]/1024) - (filedetails["size"]/1024%0.1)) .. "k"
- else
- filedetails["size"]=filedetails["size"]
- end
- return filedetails
-end
-
local function get_version ()
local f,error = io.popen("/sbin/apk_version -v -s openntpd")
local programversion = f:read("*a")
@@ -62,19 +47,7 @@ local function get_version ()
return programversion
end
-local is_running = function( process )
- local statusreport = nil
- local cmdoutput = {}
- local cmd, error = io.popen("pidof " .. process ,r)
- local cmdoutput = string.gsub(cmd:read("*a"), "%s", "")
- cmd:close()
- if (cmdoutput ~= "") then
- statusreport = "Yes"
- end
- return statusreport
-end
-
-local last_time_change = function()
+local function last_time_change()
local cmdoutput = {}
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+).*: (.*)$")
@@ -84,39 +57,13 @@ local last_time_change = function()
return cmdoutput1 .. cmdoutput2
end
-local get_confdopts = function(search)
- local opts = {}
- local searchresult = nil
- local conf_file = fs.read_file_as_array ( ntpdconfd )
- for i=1,table.maxn(conf_file) do
- local l = conf_file[i]
- -- Filter out commented lines
- if not string.find ( l, "^[;#].*" ) then
- local a = string.match ( l, "^%s*(%S+)%=" )
- if (a) then
- if not (opts[string.lower(a)]) then
- opts[string.lower(a)] = {}
- end
- local b = string.gsub(string.match ( l, '^%s*%S+%=(.*)' ), '"', '')
- for i=1,table.maxn(format.string_to_table(" ", b)) do
- local option = rawget(format.string_to_table(" ", b),i)
- table.insert (opts[string.lower(a)], i, option)
- if (option == search) then
- searchresult = "Yes"
- end
- end
- end
- end
- end
- return opts,searchresult
-end
-- This function needs:
-- addremove = [add|remove]
-- file = Path to the file
-- variable = e.g. "NTPD_OPTS"
-- option = What value to look for to add or remove from the variable.
-local addremove_opts = function ( addremove, file, variable, option )
+local function addremove_opts( addremove, file, variable, option )
if (string.lower(addremove) == "remove" ) then
cmdtxt = "/bin/sed -i 's/\\(" .. variable .. ".*\\)" .. option .. "/\\1/' " .. file
local cmd, error = io.popen ( cmdtxt )
@@ -135,7 +82,7 @@ local addremove_opts = function ( addremove, file, variable, option )
end
return cmdtxt
end
-local addremove_config = function ( addremove, file, variable )
+local function addremove_config( addremove, file, variable )
-- Notes on known/unknown bugs: Remove 'server www.test.org' wont work if config has multiple space/tab e.g. 'server www.test.org'
-- FIXME: Make num-space unsensetive.
-- FIXME: Can hold multiple rows with same values (when deleting... every equal row is deleted)
@@ -160,30 +107,21 @@ end
-- PUBLIC FUNCTIONS
function startstop_service ( self, state )
- local status = {}
- -- This is a strange hack to get the init.d script working
- local f,err = io.popen("PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin /etc/init.d/ntpd " .. state)
- local config = f:read("*a")
- f:close()
- if (config == "") then
- config = "OK!"
- end
- status.status = config
- return status
+ return daemoncontrol.daemoncontrol("ntpd", state)
end
function modify_config (self, addremove, file, variable)
- if (file == nil) then file = ntpdconfig end
+ if (file == nil) then file = configfile end
-- See to that only *my* configs are modyfied.
- if (file == ntpdconfig) or (file == ntpdconfd) then
+ if (file == configfile) or (file == confdfile) then
return addremove_config(addremove, file, variable)
end
end
function modify_opts (self, addremove, file, variable, opts)
-- See to that only *my* configs are modyfied.
- if (file == ntpdconfig) or (file == ntpdconfd) then
+ if (file == configfile) or (file == confdfile) then
-- See to that the variable/option only exists once
if (addremove == "add") then
local remove = addremove_opts( "remove", file, variable, opts )
@@ -192,26 +130,26 @@ function modify_opts (self, addremove, file, variable, opts)
end
end
-function get ()
- local path = ntpdconfig
- local config = {}
+function getstatus ()
+ local path = configfile
+ local status = {}
if not (fs.is_file(path)) then
local file_result,err = fs.write_file(path, "")
end
- local startstop = is_running ("ntpd")
- local config = config_content ( path )
- if (config["listen"]) then
- server = "Yes"
- else
- server = "No"
- end
- config["version"] = string.match(get_version(), "^(%S*)" )
- config["date"] = os.date()
- config["enabled"] = startstop
- config["confd"],config["setstimeonstartup"] = get_confdopts("-s")
- config["listenstate"] = server
- config["timechanged"] = last_time_change()
- config["timezone"] = date.what_tz()
+ status["version"] = string.match(get_version(), "^(%S*)" )
+ status["date"] = os.date()
+ status["enabled"] = procps.pidof("ntpd")
+ status["setstimeonstartup"] = getopts.getoptsfromfile(confdfile,"NTPD_OPTS", "-s")
+ status["listenstate"] = server
+ status["timechanged"] = last_time_change()
+ return status
+end
+
+function getconfig ()
+ local path = configfile
+ local config = {}
+ config = getopts.getoptsfromfile(confdfile)
+ config["variables"] = config_content(path)
return config
end
@@ -225,27 +163,17 @@ function get_logfile ()
me.cmd = cmdtxt
return me
end
-function get_filecontent (self)
- local path = ntpdconfig
- local file_content = get()
- if (fs.is_file(path)) then
- local filedetails = file_info(path)
- local configstatus = get()
- local file = io.open( path )
- local file_result = file:read("*a") or "unknown"
- file_content["details"]=filedetails
- file_content["content"]=file_result
- file:close()
- else
- file_content = {value="", errtxt="File is missing, but will be created when you save your new settings",filedetails={longname=path, size="0", mtimelong=""}}
- end
- return file_content
+function get_filedetails()
+ local filedetails = {}
+ local path = configfile
+ filedetails.details = fs.stat(path)
+ filedetails.content = fs.read_file(path)
+ return filedetails
end
function update_filecontent (self, modifications)
- local path = ntpdconfig
+ local path = configfile
local file_result,err = fs.write_file(path, format.dostounix(modifications))
- file_content = get_filecontent()
- return file_content
+ return file_result
end
diff --git a/openntpd-status-html.lsp b/openntpd-status-html.lsp
index 5612f57..43b4a35 100644
--- a/openntpd-status-html.lsp
+++ b/openntpd-status-html.lsp
@@ -2,22 +2,39 @@
<h1>SYSTEM INFO</h1>
+<dl>
<dt>Program status</dt>
<DD><? if (view.status.enabled) then io.write('Enabled') else io.write('Disabled') end ?></DD>
+</dl>
+<dl>
<dt>Program version</dt>
<dd><?= view.status.version ?></dd>
+</dl>
<H2>PROGRAM SPECIFIC OPTIONS/INFORMATION</H2>
+<? --[[ ?>
+<dl>
<dt>Configured as server (listens)</dt>
<dd><? io.write(view.status.listenstate) ?></dd>
+</dl>
+<? --]] ?>
+<dl>
+<dt>Sets time directly at startup</dt>
+<dd><? if (view.status.setstimeonstartup) then io.write("Yes") else io.write("No") end ?></dd>
+</dl>
+
+<dl>
<dt>Current time</dt>
<dd><? io.write(view.status.date) ?></dd>
+</dl>
+<dl>
<dt>Previous time adjustment</dt>
<dd><? io.write(view.status.timechanged) ?></dd>
+</dl>
<?
--[[ DEBUG INFORMATION
@@ -25,3 +42,4 @@ require("debugs")
io.write(debugs.variables(view))
--]]
?>
+