Browse Source

Added initial reload() command to sync FirewallD state at startup.

master
Ruel Tmeizeh - RuhNet 10 months ago
parent
commit
baf10924af
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      main.go

+ 6
- 1
main.go View File

@ -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())


Loading…
Cancel
Save