summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMika Havela <mika.havela@gmail.com>2008-03-28 13:57:13 +0000
committerMika Havela <mika.havela@gmail.com>2008-03-28 13:57:13 +0000
commit3256e483f43f14b90964bea722f4ff42fd19252e (patch)
tree61d53d0c7669f9b687eefd5cd8d2cd33e97723b7
parent127c68631453c3ad90203f05cffdc7eb6ed94381 (diff)
downloadacf-tinydns-3256e483f43f14b90964bea722f4ff42fd19252e.tar.bz2
acf-tinydns-3256e483f43f14b90964bea722f4ff42fd19252e.tar.xz
Adding information of autostart sequence.
git-svn-id: svn://svn.alpinelinux.org/acf/tinydns/trunk@860 ab2d0c66-481e-0410-8bed-d214d4d58bed
-rwxr-xr-xtinydns-config-html.lsp2
-rw-r--r--tinydns-model.lua21
-rw-r--r--tinydns-status-html.lsp2
3 files changed, 23 insertions, 2 deletions
diff --git a/tinydns-config-html.lsp b/tinydns-config-html.lsp
index f0628e9..b708d93 100755
--- a/tinydns-config-html.lsp
+++ b/tinydns-config-html.lsp
@@ -35,7 +35,7 @@ end
<H1>SYSTEM INFO</H1>
<?
local myform = form.status
-local tags = { "status", "version", }
+local tags = { "status", "version", "autostart", }
displayinfo(myform,tags,"viewonly")
?>
diff --git a/tinydns-model.lua b/tinydns-model.lua
index 7bfa69e..00918ca 100644
--- a/tinydns-model.lua
+++ b/tinydns-model.lua
@@ -76,6 +76,20 @@ local function recursedir(path, filearray)
end
end
+local function autostarts()
+ local cmd_output_result
+ local cmd = "/sbin/rc_status | egrep '^S' | egrep '" .. processname .."' 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
+
-- Functin to split items into a table
local function split_config_items(orgitem)
local delimiter = ":"
@@ -253,6 +267,13 @@ function getstatus()
value=configfiles,
})
+ local autostart_sequense, autostart_errtxt = autostarts()
+ status.autostart = cfe({ name="autostart",
+ label="Autostart sequence",
+ value=autostart_sequense,
+ errtxt=autostart_errtxt,
+ })
+
return status
end
diff --git a/tinydns-status-html.lsp b/tinydns-status-html.lsp
index dd7a720..06b5339 100644
--- a/tinydns-status-html.lsp
+++ b/tinydns-status-html.lsp
@@ -35,7 +35,7 @@ end
<H1>SYSTEM INFO</H1>
<?
local myform = form.status
-local tags = { "status", "version", }
+local tags = { "status", "version", "autostart", }
displayinfo(myform,tags,"viewonly")
?>