summaryrefslogtreecommitdiffhomepage
path: root/libs/lucid/luasrc/lucid.lua
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2009-07-27 12:28:34 +0000
committerSteven Barth <steven@midlink.org>2009-07-27 12:28:34 +0000
commit45cf10a665c6b7434cd44659426217d80865b3e1 (patch)
tree80427358bbe001feedab9b4660ef6f5be6b894ca /libs/lucid/luasrc/lucid.lua
parent17e7f67a7c0bbfa26154005a49faf74b3573ff5d (diff)
Add luci.lucid.running()
Diffstat (limited to 'libs/lucid/luasrc/lucid.lua')
-rw-r--r--libs/lucid/luasrc/lucid.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/libs/lucid/luasrc/lucid.lua b/libs/lucid/luasrc/lucid.lua
index d743269fe3..4feb159a50 100644
--- 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"))