797 local array, set = require "util.array", require "util.set"; |
797 local array, set = require "util.array", require "util.set"; |
798 local it = require "util.iterators"; |
798 local it = require "util.iterators"; |
799 local ok = true; |
799 local ok = true; |
800 local function disabled_hosts(host, conf) return host ~= "*" and conf.enabled ~= false; end |
800 local function disabled_hosts(host, conf) return host ~= "*" and conf.enabled ~= false; end |
801 local function enabled_hosts() return it.filter(disabled_hosts, pairs(config.getconfig())); end |
801 local function enabled_hosts() return it.filter(disabled_hosts, pairs(config.getconfig())); end |
|
802 if not what or what == "disabled" then |
|
803 local disabled_hosts = set.new(); |
|
804 for host, host_options in it.filter("*", pairs(config.getconfig())) do |
|
805 if host_options.enabled == false then |
|
806 disabled_hosts:add(host); |
|
807 end |
|
808 end |
|
809 if not disabled_hosts:empty() then |
|
810 local msg = "Checks will be skipped for these disabled hosts: %s"; |
|
811 if what then msg = "These hosts are disabled: %s"; end |
|
812 show_warning(msg, tostring(disabled_hosts)); |
|
813 if what then return 0; end |
|
814 print"" |
|
815 end |
|
816 end |
802 if not what or what == "config" then |
817 if not what or what == "config" then |
803 print("Checking config..."); |
818 print("Checking config..."); |
804 local known_global_options = set.new({ |
819 local known_global_options = set.new({ |
805 "pidfile", "log", "plugin_paths", "prosody_user", "prosody_group", "daemonize", |
820 "pidfile", "log", "plugin_paths", "prosody_user", "prosody_group", "daemonize", |
806 "umask", "prosodyctl_timeout", "use_ipv6", "use_libevent", "network_settings" |
821 "umask", "prosodyctl_timeout", "use_ipv6", "use_libevent", "network_settings" |