X-Git-Url: http://git.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=libs%2Flucid%2Fluasrc%2Flucid.lua;h=4feb159a50a6c662665e77d352fbe315b58b81ff;hp=d743269fe3fbe2c4c0a2e3f7c3a75dcbddc9a15e;hb=45cf10a665c6b7434cd44659426217d80865b3e1;hpb=17e7f67a7c0bbfa26154005a49faf74b3573ff5d 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"))