Changeset

13167:6226f75f55a7

prosodyctl: Add experimental way to reload specific modules directly Mostly thinking out loud about how various actions may use the shell This enables the following sequence of commands: prosodyctl install mod_example prosodyctl reload mod_example which is simpler than prosodyctl shell module reload example
author Kim Alvefur <zash@zash.se>
date Sun, 25 Jun 2023 17:34:13 +0200
parents 13166:e6e76f64ebb6
children 13168:536055476912
files prosodyctl
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/prosodyctl	Sat May 20 20:44:20 2023 +0200
+++ b/prosodyctl	Sun Jun 25 17:34:13 2023 +0200
@@ -565,6 +565,15 @@
 		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);
+	end
+
 	service_command_warning("reload");
 
 	if not prosodyctl.isrunning() then