projects
/
oweals
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
17e7f67
)
Add luci.lucid.running()
author
Steven Barth
<steven@midlink.org>
Mon, 27 Jul 2009 12:28:34 +0000
(12:28 +0000)
committer
Steven Barth
<steven@midlink.org>
Mon, 27 Jul 2009 12:28:34 +0000
(12:28 +0000)
libs/lucid/luasrc/lucid.lua
patch
|
blob
|
history
diff --git
a/libs/lucid/luasrc/lucid.lua
b/libs/lucid/luasrc/lucid.lua
index d743269fe3fbe2c4c0a2e3f7c3a75dcbddc9a15e..4feb159a50a6c662665e77d352fbe315b58b81ff 100644
(file)
--- a/
libs/lucid/luasrc/lucid.lua
+++ b/
libs/lucid/luasrc/lucid.lua
@@
-60,6
+60,12
@@
function start()
run()
end
+--- Returns the PID of the currently active LuCId process.
+function running()
+ local pid = tonumber(state:get(UCINAME, "main", "pid"))
+ return pid and nixio.kill(pid, 0) and pid
+end
+
--- Stops any running LuCId superprocess.
function stop()
local pid = tonumber(state:get(UCINAME, "main", "pid"))