# HG changeset patch # User Kim Alvefur # Date 1399013763 -7200 # Node ID fbc3b195dab8081f80e844c2df596290ce12cb62 # Parent afcba9737ac3610e21444a1c28f60ae418ab257d prosodyctl: Check that there is at least one enabled VirtualHost (or Component) defined diff -r afcba9737ac3 -r fbc3b195dab8 prosodyctl --- a/prosodyctl Fri May 02 08:27:29 2014 +0200 +++ b/prosodyctl Fri May 02 08:56:03 2014 +0200 @@ -831,6 +831,17 @@ 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);