aboutsummaryrefslogtreecommitdiffstats
path: root/util/prosodyctl.lua
diff options
context:
space:
mode:
authorJo?o Duarte <jvsDuarte08@gmail.com>2019-06-25 13:20:54 +0100
committerJo?o Duarte <jvsDuarte08@gmail.com>2019-06-25 13:20:54 +0100
commit4af3c3997c55fc0e1afc6cac160a7a0919b7e954 (patch)
treea3382cb39e44819e43e4e85f1b0889275c6a2211 /util/prosodyctl.lua
parentab88117d108ace278c66dc17eed17c30b992d0ce (diff)
downloadprosody-4af3c3997c55fc0e1afc6cac160a7a0919b7e954.tar.gz
prosody-4af3c3997c55fc0e1afc6cac160a7a0919b7e954.zip
util.prosodyctl: Moved the 'admin_operation' function from prosodyctl to here
Diffstat (limited to 'util/prosodyctl.lua')
-rw-r--r--util/prosodyctl.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/util/prosodyctl.lua b/util/prosodyctl.lua
index 9b627bde..e2bc4369 100644
--- a/util/prosodyctl.lua
+++ b/util/prosodyctl.lua
@@ -278,6 +278,22 @@ local function reload()
return true;
end
+local function admin_operation(operation, arg)
+ local modules, tree, server, refresh = "", "", "", ""
+ for i, _ in ipairs(arg) do
+ if arg[i]:sub(1, #"--tree=") == "--tree=" then
+ tree = arg[i].." "
+ elseif arg[i]:sub(1, #"--server=") == "--server=" then
+ server = arg[i].." "
+ elseif arg[i]:sub(1, #"--no-refresh") == "--no-refresh" then
+ refresh = arg[i].." "
+ else
+ modules=modules..arg[i].." "
+ end
+ end
+ os.execute("luarocks-admin "..tree..operation..server..refresh..modules)
+end
+
return {
show_message = show_message;
show_warning = show_message;
@@ -297,4 +313,5 @@ return {
start = start;
stop = stop;
reload = reload;
+ admin_operation = admin_operation;
};