luci-base: add luci/getProcessList RPC method
authorJo-Philipp Wich <jo@mein.io>
Sun, 3 Nov 2019 17:43:44 +0000 (18:43 +0100)
committerJo-Philipp Wich <jo@mein.io>
Sun, 3 Nov 2019 19:03:25 +0000 (20:03 +0100)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/root/usr/libexec/rpcd/luci

index 10c1691b966858a10ff91414ed885345f29ff7a2..5bd17c75d295ff6a93ae15df16c90db48aa90946 100755 (executable)
@@ -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
        }
 }