FW3_OPT("path", string, include, path),
FW3_OPT("type", include_type, include, type),
FW3_OPT("family", family, include, family),
+ FW3_OPT("reload", bool, include, reload),
{ }
};
static void
-print_include(enum fw3_family family, struct fw3_include *include)
+print_include(struct fw3_include *include, enum fw3_family family)
{
FILE *f;
char line[1024];
}
void
-fw3_print_includes(enum fw3_family family, struct fw3_state *state)
+fw3_print_includes(struct fw3_state *state, enum fw3_family family, bool reload)
{
struct fw3_include *include;
list_for_each_entry(include, &state->includes, list)
+ {
+ if (reload && !include->reload)
+ continue;
+
if (include->type == FW3_INC_TYPE_RESTORE)
- print_include(family, include);
+ print_include(include, family);
+ }
}
}
void
-fw3_run_includes(struct fw3_state *state)
+fw3_run_includes(struct fw3_state *state, bool reload)
{
struct fw3_include *include;
list_for_each_entry(include, &state->includes, list)
+ {
+ if (reload && !include->reload)
+ continue;
+
if (include->type == FW3_INC_TYPE_SCRIPT)
run_include(include);
+ }
}
extern const struct fw3_option fw3_include_opts[];
void fw3_load_includes(struct fw3_state *state, struct uci_package *p);
-void fw3_print_includes(enum fw3_family family, struct fw3_state *state);
-void fw3_run_includes(struct fw3_state *state);
+
+void fw3_print_includes(struct fw3_state *state, enum fw3_family family,
+ bool reload);
+
+void fw3_run_includes(struct fw3_state *state, bool reload);
#define fw3_free_include(include) \
fw3_free_object(include, fw3_include_opts)
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);
if (!print_rules)
{
- if (!reload)
- fw3_run_includes(state);
-
+ fw3_run_includes(state, reload);
fw3_hotplug_zones(true, state);
fw3_write_statefile(state);
}