mod_s2s_reload_newcomponent/mod_s2s_reload_newcomponent.lua
author Stephen Paul Weber <singpolyma@singpolyma.net>
Mon, 11 Mar 2024 19:28:19 -0500
changeset 5864 fdff8cb54302
parent 2785 fe5bb7b13a59
permissions -rw-r--r--
mod_report_forward: fix address detection when there are multiple field values

local modulemanager = require "core.modulemanager";
local config = require "core.configmanager";

module.host = "*";

local function reload_components()
        local defined_hosts = config.getconfig();

        for host in pairs(defined_hosts) do
                if (not hosts[host] and host ~= "*") then
                        module:log ("debug", "loading new component %s", host);
                        modulemanager.load(host, config.get(host, "core", "component_module"));
                end
        end;

        return;
end

module:hook("config-reloaded", reload_components);