From a7bbeac47e2bbb86f823775e047615534481c2f2 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 25 Jun 2023 17:34:13 +0200 Subject: 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 --- prosodyctl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/prosodyctl b/prosodyctl index 722e8ff2..d65760ca 100755 --- a/prosodyctl +++ b/prosodyctl @@ -565,6 +565,15 @@ 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); + end + service_command_warning("reload"); if not prosodyctl.isrunning() then -- cgit v1.2.3