# HG changeset patch # User Matthew Wild # Date 1738851856 0 # Node ID 263ae995bc86f2d7325475da6e9b1c5b06dae40c # Parent e5f62871e6a5170b2c633bd3abaf80ef9f09b3ca prosodyctl: reload: use admin socket to issue reload command, if available diff -r e5f62871e6a5 -r 263ae995bc86 prosodyctl --- a/prosodyctl Thu Feb 06 14:23:15 2025 +0000 +++ b/prosodyctl Thu Feb 06 14:24:16 2025 +0000 @@ -502,13 +502,17 @@ 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");