summaryrefslogtreecommitdiffstats
path: root/openntpd-model.lua
diff options
context:
space:
mode:
authorMika Havela <mika.havela@gmail.com>2008-03-28 14:01:48 +0000
committerMika Havela <mika.havela@gmail.com>2008-03-28 14:01:48 +0000
commitb69be59fb5ce80e02b2e1c981c4202413a9eec14 (patch)
tree7d010ce2ffa604addb07f36657b132b4be62b1d4 /openntpd-model.lua
parent493b4d7a5cd82c768a88c51d20a493b3dea1a732 (diff)
downloadacf-openntpd-b69be59fb5ce80e02b2e1c981c4202413a9eec14.tar.bz2
acf-openntpd-b69be59fb5ce80e02b2e1c981c4202413a9eec14.tar.xz
Added info about autostart sequence.
git-svn-id: svn://svn.alpinelinux.org/acf/openntpd/trunk@863 ab2d0c66-481e-0410-8bed-d214d4d58bed
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