Implement reload option for includes to decide whether includes should get reloaded...
[project/firewall3.git] / main.c
diff --git a/main.c b/main.c
index c1f6505..90ef820 100644 (file)
--- a/main.c
+++ b/main.c
@@ -171,6 +171,9 @@ stop(struct fw3_state *state, bool complete, bool reload)
                return rv;
        }
 
+       if (!print_rules)
+               fw3_hotplug_zones(false, state);
+
        for (family = FW3_FAMILY_V4; family <= FW3_FAMILY_V6; family++)
        {
                if (!complete && !family_running(state, family))
@@ -290,8 +293,7 @@ start(struct fw3_state *state, bool reload)
                        fw3_pr("COMMIT\n");
                }
 
-               if (!reload)
-                       fw3_print_includes(family, state);
+               fw3_print_includes(state, family, reload);
 
                fw3_command_close();
                family_set(state, family, true);
@@ -303,11 +305,12 @@ start(struct fw3_state *state, bool reload)
        {
                fw3_set_defaults(state);
 
-               if (!reload && !print_rules)
-                       fw3_run_includes(state);
-
                if (!print_rules)
+               {
+                       fw3_run_includes(state, reload);
+                       fw3_hotplug_zones(true, state);
                        fw3_write_statefile(state);
+               }
        }
 
        return rv;