mod_s2s: Remove redundant setting of session.direction
[prosody.git] / prosodyctl
index 7280ab88812473540b1365da50d4bdde21a72b5f..d9ae9b736ce0cbb1f8724845a536fb7112188e3f 100755 (executable)
@@ -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);
@@ -1115,8 +1126,8 @@ function commands.check(arg)
                                                        print("    Not vaild for client connections to "..host..".")
                                                        cert_ok = false
                                                end
-                                               if (not (config.get(name, "anonymous_login")
-                                                       or config.get(name, "authentication") == "anonymous"))
+                                               if (not (config.get(host, "anonymous_login")
+                                                       or config.get(host, "authentication") == "anonymous"))
                                                        and not x509_verify_identity(host, "_xmpp-client", cert) then
                                                        print("    Not vaild for server-to-server connections to "..host..".")
                                                        cert_ok = false