diff options
-rw-r--r-- | openntpd-config-html.lsp | 2 | ||||
-rw-r--r-- | openntpd-expert-html.lsp | 2 | ||||
-rw-r--r-- | openntpd-logfile-html.lsp | 2 | ||||
-rw-r--r-- | openntpd-model.lua | 20 | ||||
-rw-r--r-- | openntpd-status-html.lsp | 2 |
5 files changed, 24 insertions, 4 deletions
diff --git a/openntpd-config-html.lsp b/openntpd-config-html.lsp index d61caa2..77a38dc 100644 --- a/openntpd-config-html.lsp +++ b/openntpd-config-html.lsp @@ -46,7 +46,7 @@ end <DL> <? local myform = form.status -local tags = { "status", "version", } +local tags = { "status", "version", "autostart", } displayinfo(myform,tags,"viewonly") ?> </DL> diff --git a/openntpd-expert-html.lsp b/openntpd-expert-html.lsp index 13825ec..cf70091 100644 --- a/openntpd-expert-html.lsp +++ b/openntpd-expert-html.lsp @@ -44,7 +44,7 @@ end <DL> <? local myform = form.status -local tags = { "status", "version", } +local tags = { "status", "version", "autostart", } displayinfo(myform,tags,"viewonly") ?> </DL> diff --git a/openntpd-logfile-html.lsp b/openntpd-logfile-html.lsp index e9bf0e4..5ac4d2d 100644 --- a/openntpd-logfile-html.lsp +++ b/openntpd-logfile-html.lsp @@ -45,7 +45,7 @@ end <DL> <? local myform = form.status -local tags = { "status", "version", } +local tags = { "status", "version", "autostart", } displayinfo(myform,tags,"viewonly") ?> </DL> diff --git a/openntpd-model.lua b/openntpd-model.lua index d2c726c..78ea4c6 100644 --- a/openntpd-model.lua +++ b/openntpd-model.lua @@ -60,6 +60,19 @@ local function last_time_change() return cmdoutput1 .. cmdoutput2 end +local function autostarts() + local cmd_output_result + local cmd = "/sbin/rc_status | egrep '^S' | egrep '" .. processname_short .."' 2>/dev/null" + local f = io.popen( cmd ) + local cmdresult = f:read("*a") + if (cmdresult) and (#cmdresult > 0) then + cmd_output_result = "Process will autostart at next boot (at sequence '" .. string.match(cmdresult,"^%a+(%d%d)") .. "')" + else + cmd_output_error = "Not programmed to autostart" + end + f:close() + return cmd_output_result, cmd_output_error +end -- This function needs: -- addremove = [add|remove] @@ -218,6 +231,13 @@ function getstatus () value=procps.pidof(processname_short), }) + local autostart_sequense, autostart_errtxt = autostarts() + status.autostart = cfe({ name="autostart", + label="Autostart sequence", + value=autostart_sequense, + errtxt=autostart_errtxt, + }) + status.date = config.date status.setstimeonstartup = config.setstimeonstartup diff --git a/openntpd-status-html.lsp b/openntpd-status-html.lsp index 69065af..8ca80d8 100644 --- a/openntpd-status-html.lsp +++ b/openntpd-status-html.lsp @@ -36,7 +36,7 @@ end <H1>SYSTEM INFO</H1> <? local myform = form.status -local tags = { "status", "version", } +local tags = { "status", "version", "autostart", } displayinfo(myform,tags,"viewonly") ?> |