summaryrefslogtreecommitdiffstats
path: root/lib/modelfunctions.lua
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2008-07-04 13:31:13 +0000
committerTed Trask <ttrask01@yahoo.com>2008-07-04 13:31:13 +0000
commited164e591fcd52f77c66f629ff00c216e4278f86 (patch)
tree7af2d09c720ce3717949833a5137fa585f352daf /lib/modelfunctions.lua
parent060b3f4716e38a69d85ce104abbc21e384fb70a5 (diff)
downloadacf-core-ed164e591fcd52f77c66f629ff00c216e4278f86.tar.bz2
acf-core-ed164e591fcd52f77c66f629ff00c216e4278f86.tar.xz
Fixed expert page to work when prefix or controller has magic characters. Added public getenabled function to modelfunctions and made controllerfunctions work with it.
git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@1273 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'lib/modelfunctions.lua')
-rw-r--r--lib/modelfunctions.lua15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/modelfunctions.lua b/lib/modelfunctions.lua
index 84c690b..0648f23 100644
--- a/lib/modelfunctions.lua
+++ b/lib/modelfunctions.lua
@@ -5,13 +5,15 @@ require("procps")
require("daemoncontrol")
require("processinfo")
-local function process_status_text(procname)
- local t = procps.pidof(procname)
+function getenabled(processname)
+ local result = cfe({ label = "Program status" })
+ local t = procps.pidof(processname)
if (t) and (#t > 0) then
- return "Enabled"
+ result.value = "Enabled"
else
- return "Disabled"
+ result.value = "Disabled"
end
+ return result
end
function startstop_service(processname, action)
@@ -30,10 +32,7 @@ function getstatus(processname, packagename, label)
errtxt=errtxt,
})
- status.status = cfe({
- label="Program status",
- value=process_status_text(processname),
- })
+ status.status = getenabled(processname)
local autostart_sequence, autostart_errtxt = processinfo.process_botsequence(processname)
status.autostart = cfe({