# HG changeset patch # User Matthew Wild # Date 1778078516 -3600 # Node ID 0f61d13ebbdeb04ef2c43c10f6692c2a930d6c39 # Parent ac6f0db675aa27d619707d7d6a7c524691c4176b mod_firewall: Update module status when scripts succeed/fail to load diff -r ac6f0db675aa -r 0f61d13ebbde mod_firewall/mod_firewall.lua --- a/mod_firewall/mod_firewall.lua Mon May 04 23:57:07 2026 +0200 +++ b/mod_firewall/mod_firewall.lua Wed May 06 15:41:56 2026 +0100 @@ -713,6 +713,7 @@ end loaded_scripts[script] = { last_modified = last_modified, events_hooked = events_hooked }; module:log("debug", "Loaded %s", script); + return true; end --COMPAT w/0.9 (no module:unhook()!) @@ -743,14 +744,19 @@ local wanted_scripts = script_list / resolve_script_path; local currently_loaded = set.new(it.to_array(it.keys(loaded_scripts))); local scripts_to_unload = currently_loaded - wanted_scripts; + local n_wanted, n_loaded = 0, 0; for script in wanted_scripts do + n_wanted = n_wanted + 1; -- If the script is already loaded, this is fine - it will -- reload the script for us if the file has changed - load_script(script); + if load_script(script) then + n_loaded = n_loaded + 1; + end end for script in scripts_to_unload do unload_script(script); end + module:log_status(n_wanted == n_loaded and "info" or "warn", "Loaded %d of %d scripts", n_loaded, n_wanted); end function module.load()