From 8d512f13ec722d623ece201c89c806dabbe3bd14 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sun, 3 Nov 2019 18:43:44 +0100 Subject: [PATCH] luci-base: add luci/getProcessList RPC method Signed-off-by: Jo-Philipp Wich --- modules/luci-base/root/usr/libexec/rpcd/luci | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/luci-base/root/usr/libexec/rpcd/luci b/modules/luci-base/root/usr/libexec/rpcd/luci index 10c1691b96..5bd17c75d2 100755 --- a/modules/luci-base/root/usr/libexec/rpcd/luci +++ b/modules/luci-base/root/usr/libexec/rpcd/luci @@ -582,6 +582,17 @@ local methods = { local sys = require "luci.sys" return { result = sys.net.conntrack() } end + }, + + getProcessList = { + call = function() + local sys = require "luci.sys" + local res = {} + for _, v in pairs(sys.process.list()) do + res[#res + 1] = v + end + return { result = res } + end } } -- 2.30.2