aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2025-02-06 14:24:16 +0000
committerMatthew Wild <mwild1@gmail.com>2025-02-06 14:24:16 +0000
commitf2e87307a4e861694b57aa2a13a7673fd67bd37b (patch)
tree0e12f47d6a06e83ea694a07ca5415e1104b68f1b
parent137733375178e2483ee5404a374ca5aec6c65291 (diff)
downloadprosody-f2e87307a4e861694b57aa2a13a7673fd67bd37b.tar.gz
prosody-f2e87307a4e861694b57aa2a13a7673fd67bd37b.zip
prosodyctl: reload: use admin socket to issue reload command, if available
-rwxr-xr-xprosodyctl18
1 files changed, 11 insertions, 7 deletions
diff --git a/prosodyctl b/prosodyctl
index ea8f0a8c..5e623e12 100755
--- a/prosodyctl
+++ b/prosodyctl
@@ -502,13 +502,17 @@ function commands.reload(arg)
return 0;
end
- if arg[1] and arg[1]:match"^mod_" then
- -- TODO reword the usage text, document
- local shell = require "prosody.util.prosodyctl.shell";
- arg[1] = arg[1]:match("^mod_(.*)"); -- strip mod_ prefix
- table.insert(arg, 1, "module");
- table.insert(arg, 2, "reload");
- return shell.shell(arg);
+ local shell = require "prosody.util.prosodyctl.shell";
+ if shell.available() then
+ if arg[1] and arg[1]:match"^mod_" then
+ -- TODO reword the usage text, document
+ local shell = require "prosody.util.prosodyctl.shell";
+ arg[1] = arg[1]:match("^mod_(.*)"); -- strip mod_ prefix
+ table.insert(arg, 1, "module");
+ table.insert(arg, 2, "reload");
+ return shell.shell(arg);
+ end
+ return shell.shell({ "config", "reload" });
end
service_command_warning("reload");