summaryrefslogtreecommitdiffstats
path: root/openntpd-model.lua
diff options
context:
space:
mode:
Diffstat (limited to 'openntpd-model.lua')
-rw-r--r--openntpd-model.lua20
1 files changed, 20 insertions, 0 deletions
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