aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xprosodyctl16
-rw-r--r--util/prosodyctl.lua17
2 files changed, 17 insertions, 16 deletions
diff --git a/prosodyctl b/prosodyctl
index 75b36e34..05f711d7 100755
--- a/prosodyctl
+++ b/prosodyctl
@@ -98,22 +98,6 @@ function commands.list(arg)
end
end
-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
-
function commands.admin_add(arg)
admin_operation("add ", arg)
end
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;
};