diff options
author | Kim Alvefur <zash@zash.se> | 2014-05-02 08:56:03 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2014-05-02 08:56:03 +0200 |
commit | fda97ec24221701d82864b0b32e2eab72d5d5b6d (patch) | |
tree | e87a45f93a557eb0bd8d6619d0027168c107546d /prosodyctl | |
parent | 37c6234c0cc2d5708ad61a84a6a57c8fed2110e9 (diff) | |
download | prosody-fda97ec24221701d82864b0b32e2eab72d5d5b6d.tar.gz prosody-fda97ec24221701d82864b0b32e2eab72d5d5b6d.zip |
prosodyctl: Check that there is at least one enabled VirtualHost (or Component) defined
Diffstat (limited to 'prosodyctl')
-rwxr-xr-x | prosodyctl | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -831,6 +831,17 @@ function commands.check(arg) print(" No global options defined. Perhaps you have put a host definition at the top") print(" of the config file? They should be at the bottom, see http://prosody.im/doc/configure#overview"); end + if it.count(enabled_hosts()) == 0 then + ok = false; + print(""); + if it.count(it.filter("*", pairs(config))) == 0 then + print(" No hosts are defined, please add at least one VirtualHost section") + elseif config["*"]["enabled"] == false then + print(" No hosts are enabled. Remove enabled = false from the global section or put enabled = true under at least one VirtualHost section") + else + print(" All hosts are disabled. Remove enabled = false from at least one VirtualHost section") + end + end -- Check for global options under hosts local global_options = set.new(it.to_array(it.keys(config["*"]))); local deprecated_global_options = set.intersection(global_options, deprecated); |