aboutsummaryrefslogtreecommitdiffstats
path: root/prosodyctl
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2014-05-02 08:16:26 +0200
committerKim Alvefur <zash@zash.se>2014-05-02 08:16:26 +0200
commit960486904550db5e32646e8356ef19e8b7ad050a (patch)
tree878d03d89d3c798ff11b91b27446572c7593f20d /prosodyctl
parent5212d9be5c2b3ce6c0f537bbb2a7ce0e566c70a1 (diff)
downloadprosody-960486904550db5e32646e8356ef19e8b7ad050a.tar.gz
prosody-960486904550db5e32646e8356ef19e8b7ad050a.zip
prosodyctl: Add check that points out any disabled hosts
Diffstat (limited to 'prosodyctl')
-rwxr-xr-xprosodyctl15
1 files changed, 15 insertions, 0 deletions
diff --git a/prosodyctl b/prosodyctl
index a1849033..79d714eb 100755
--- a/prosodyctl
+++ b/prosodyctl
@@ -799,6 +799,21 @@ function commands.check(arg)
local ok = true;
local function disabled_hosts(host, conf) return host ~= "*" and conf.enabled ~= false; end
local function enabled_hosts() return it.filter(disabled_hosts, pairs(config.getconfig())); end
+ if not what or what == "disabled" then
+ local disabled_hosts = set.new();
+ for host, host_options in it.filter("*", pairs(config.getconfig())) do
+ if host_options.enabled == false then
+ disabled_hosts:add(host);
+ end
+ end
+ if not disabled_hosts:empty() then
+ local msg = "Checks will be skipped for these disabled hosts: %s";
+ if what then msg = "These hosts are disabled: %s"; end
+ show_warning(msg, tostring(disabled_hosts));
+ if what then return 0; end
+ print""
+ end
+ end
if not what or what == "config" then
print("Checking config...");
local known_global_options = set.new({