Software /
code /
prosody
Comparison
prosodyctl @ 13644:263ae995bc86
prosodyctl: reload: use admin socket to issue reload command, if available
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 06 Feb 2025 14:24:16 +0000 |
parent | 13612:8617f5962e47 |
child | 13645:7f6f0e47624a |
comparison
equal
deleted
inserted
replaced
13643:e5f62871e6a5 | 13644:263ae995bc86 |
---|---|
500 if opts.help then | 500 if opts.help then |
501 show_usage([[reload]], [[Reload Prosody's configuration and re-open log files]]); | 501 show_usage([[reload]], [[Reload Prosody's configuration and re-open log files]]); |
502 return 0; | 502 return 0; |
503 end | 503 end |
504 | 504 |
505 if arg[1] and arg[1]:match"^mod_" then | 505 local shell = require "prosody.util.prosodyctl.shell"; |
506 -- TODO reword the usage text, document | 506 if shell.available() then |
507 local shell = require "prosody.util.prosodyctl.shell"; | 507 if arg[1] and arg[1]:match"^mod_" then |
508 arg[1] = arg[1]:match("^mod_(.*)"); -- strip mod_ prefix | 508 -- TODO reword the usage text, document |
509 table.insert(arg, 1, "module"); | 509 local shell = require "prosody.util.prosodyctl.shell"; |
510 table.insert(arg, 2, "reload"); | 510 arg[1] = arg[1]:match("^mod_(.*)"); -- strip mod_ prefix |
511 return shell.shell(arg); | 511 table.insert(arg, 1, "module"); |
512 table.insert(arg, 2, "reload"); | |
513 return shell.shell(arg); | |
514 end | |
515 return shell.shell({ "config", "reload" }); | |
512 end | 516 end |
513 | 517 |
514 service_command_warning("reload"); | 518 service_command_warning("reload"); |
515 | 519 |
516 if not prosodyctl.isrunning() then | 520 if not prosodyctl.isrunning() then |