aboutsummaryrefslogtreecommitdiffstats
path: root/prosodyctl
diff options
context:
space:
mode:
authorVladimir Protasov <eoranged@ya.ru>2011-08-04 21:26:15 +0400
committerVladimir Protasov <eoranged@ya.ru>2011-08-04 21:26:15 +0400
commite07ca0e54999e7e09b9c1f73709828ebc1b95e7f (patch)
tree710127305f28052eb782d092c9ceda8c29cf5123 /prosodyctl
parentd305ad9eda1ab8cd61b65a4e5f6b85a4a40c6655 (diff)
downloadprosody-e07ca0e54999e7e09b9c1f73709828ebc1b95e7f.tar.gz
prosody-e07ca0e54999e7e09b9c1f73709828ebc1b95e7f.zip
Add "reload" command to prosodyctl
Diffstat (limited to 'prosodyctl')
-rwxr-xr-xprosodyctl23
1 files changed, 22 insertions, 1 deletions
diff --git a/prosodyctl b/prosodyctl
index bb90b685..470a7d55 100755
--- a/prosodyctl
+++ b/prosodyctl
@@ -538,6 +538,27 @@ function commands.about(arg)
print("");
end
+function commands.reload(arg)
+ if arg[1] == "--help" then
+ show_usage([[reload]], [[Reload prosody configuration file]]);
+ return 1;
+ end
+
+ if not prosodyctl.isrunning() then
+ show_message("Prosody is not running");
+ return 1;
+ end
+
+ local ok, ret = prosodyctl.reload();
+ if ok then
+
+ show_message("Config updated");
+ return 0;
+ end
+
+ show_message(error_messages[ret]);
+ return 1;
+end
-- ejabberdctl compatibility
function commands.register(arg)
@@ -641,7 +662,7 @@ if not commands[command] then -- Show help for all commands
print("Where COMMAND may be one of:\n");
local hidden_commands = require "util.set".new{ "register", "unregister", "addplugin" };
- local commands_order = { "adduser", "passwd", "deluser", "start", "stop", "restart", "about" };
+ local commands_order = { "adduser", "passwd", "deluser", "start", "stop", "restart", "reload", "about" };
local done = {};