From baf10924afd419fe6d95591fbab5ba20e46c7740 Mon Sep 17 00:00:00 2001 From: Ruel Tmeizeh - RuhNet Date: Wed, 19 Feb 2025 15:01:05 -0500 Subject: [PATCH] Added initial reload() command to sync FirewallD state at startup. --- main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index ba02028..a7e9409 100644 --- a/main.go +++ b/main.go @@ -117,7 +117,12 @@ func main() { ipcache = NewTTL(appconf.CacheTimeout, firewallDelete) if appconf.FirewallType == "firewalld" { - //_ = reload() //reload firewalld to reset firewall state (done as part of maybeCreateZone) + logit(5, "reloading FirewallD...") + err = reload() //reload firewalld to reset firewall state + if err != nil { + fmt.Println("FirewallD could not be reloaded! (Is firewalld running?): " + err.Error()) + log.Fatal("FirewallD could not be reloaded. (Is firewalld running?): " + err.Error()) + } err = maybeSetupZone(appconf.FirewallZone) //reload firewalld to reset firewall state if err != nil { fmt.Println("Firewall zone '" + appconf.FirewallZone + "' could not be created. (Is firewalld running?): " + err.Error())