mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-09-15 01:19:29 +02:00
* Fixes #1635: included code generated by the configlet
run_time_address_tables into script for all linux-based host OS
This commit is contained in:
+11
-1
@@ -1,9 +1,19 @@
|
||||
2010-07-23 Vadim Kurland <vadim@vk.crocodile.org>
|
||||
|
||||
* Fixes #1635: included code generated by the configlet
|
||||
run_time_address_tables into script for all linux-based host
|
||||
OS (dd-wrt, openwrt, ipcop) even though most of they do not
|
||||
support ipset at this time. If ipset is not supported because
|
||||
iptables version is too old or the module is simply not available
|
||||
for the platform, user can just uncheck the checkbox in the
|
||||
firewall settings dialog and code generated by the configlet will
|
||||
support method of loading addresses from the file at run time
|
||||
based on script variables and a "while" loop.
|
||||
|
||||
* script_skeleton: added command line argument "reload_ipset"
|
||||
that calls function reload_ipset and takes two additional
|
||||
arguments: set name and file name.
|
||||
|
||||
|
||||
* script_skeleton (cmd): calling functions to check if data files
|
||||
used by run time address table objects are available before making
|
||||
any changes to iptables policy. If files are not available, the
|
||||
|
||||
@@ -21,6 +21,8 @@ FWBDEBUG=""
|
||||
|
||||
{{$shell_functions}}
|
||||
|
||||
{{$run_time_address_tables}}
|
||||
|
||||
load_modules() {
|
||||
:
|
||||
{{$load_modules}}
|
||||
@@ -81,6 +83,11 @@ case "$cmd" in
|
||||
start)
|
||||
log "Activating firewall script generated {{$timestamp}} by {{$user}}"
|
||||
check_tools
|
||||
check_run_time_address_table_files
|
||||
{{if using_ipset}}
|
||||
check_module_ipset
|
||||
load_run_time_address_table_files
|
||||
{{endif}}
|
||||
{{if prolog_top}} prolog_commands {{endif}}
|
||||
load_modules {{$load_modules_with_nat}}
|
||||
configure_interfaces
|
||||
@@ -121,8 +128,15 @@ case "$cmd" in
|
||||
RETVAL=$?
|
||||
;;
|
||||
|
||||
## Usage: script.fw reload_ipset <set_name> <file_name>
|
||||
reload_ipset)
|
||||
{{if using_ipset}}
|
||||
reload_ipset $2 $3
|
||||
{{endif}}
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage $0 {start|stop|status|reload|interfaces|test_interfaces}"
|
||||
echo "Usage $0 {start|stop|status|reload|interfaces|test_interfaces|reload_ipset}"
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
|
||||
{{$shell_functions}}
|
||||
|
||||
{{$run_time_address_tables}}
|
||||
|
||||
load_modules() {
|
||||
:
|
||||
{{$load_modules}}
|
||||
@@ -76,6 +78,11 @@ reset_all() {
|
||||
|
||||
log "Activating firewall script generated {{$timestamp}} by {{$user}}"
|
||||
check_tools
|
||||
check_run_time_address_table_files
|
||||
{{if using_ipset}}
|
||||
check_module_ipset
|
||||
load_run_time_address_table_files
|
||||
{{endif}}
|
||||
{{if prolog_top}}prolog_commands{{endif}}
|
||||
load_modules
|
||||
configure_interfaces
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
|
||||
{{$shell_functions}}
|
||||
|
||||
{{$run_time_address_tables}}
|
||||
|
||||
verify_interfaces() {
|
||||
:
|
||||
{{$verify_interfaces}}
|
||||
@@ -55,6 +57,11 @@ reset_all() {
|
||||
case "$1" in
|
||||
start)
|
||||
check_tools
|
||||
check_run_time_address_table_files
|
||||
{{if using_ipset}}
|
||||
check_module_ipset
|
||||
load_run_time_address_table_files
|
||||
{{endif}}
|
||||
verify_interfaces
|
||||
prolog_commands
|
||||
script_body
|
||||
|
||||
@@ -25,6 +25,8 @@ FWBDEBUG=""
|
||||
|
||||
{{$shell_functions}}
|
||||
|
||||
{{$run_time_address_tables}}
|
||||
|
||||
load_modules() {
|
||||
:
|
||||
{{$load_modules}}
|
||||
@@ -76,6 +78,11 @@ reset_all() {
|
||||
start() {
|
||||
log "Activating firewall script generated {{$timestamp}} by {{$user}}"
|
||||
check_tools
|
||||
check_run_time_address_table_files
|
||||
{{if using_ipset}}
|
||||
check_module_ipset
|
||||
load_run_time_address_table_files
|
||||
{{endif}}
|
||||
{{if prolog_top}} prolog_commands {{endif}}
|
||||
load_modules {{$load_modules_with_nat}}
|
||||
configure_interfaces
|
||||
|
||||
@@ -21,6 +21,8 @@ FWBDEBUG=""
|
||||
|
||||
{{$shell_functions}}
|
||||
|
||||
{{$run_time_address_tables}}
|
||||
|
||||
load_modules() {
|
||||
:
|
||||
echo "Modules are loaded only at startup!"
|
||||
@@ -89,6 +91,11 @@ case "$cmd" in
|
||||
log "Activating firewall script generated {{$timestamp}} by {{$user}}"
|
||||
log "Database was {{$database}}"
|
||||
check_tools
|
||||
check_run_time_address_table_files
|
||||
{{if using_ipset}}
|
||||
check_module_ipset
|
||||
load_run_time_address_table_files
|
||||
{{endif}}
|
||||
{{if prolog_top}} prolog_commands {{endif}}
|
||||
load_modules {{$load_modules_with_nat}}
|
||||
configure_interfaces
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
|
||||
{{$shell_functions}}
|
||||
|
||||
{{$run_time_address_tables}}
|
||||
|
||||
## we do not load modules on Sveasoft
|
||||
load_modules() {
|
||||
:
|
||||
@@ -78,6 +80,11 @@ reset_all() {
|
||||
|
||||
log "Activating firewall script generated {{$timestamp}} by {{$user}}"
|
||||
check_tools
|
||||
check_run_time_address_table_files
|
||||
{{if using_ipset}}
|
||||
check_module_ipset
|
||||
load_run_time_address_table_files
|
||||
{{endif}}
|
||||
{{if prolog_top}}prolog_commands{{endif}}
|
||||
load_modules
|
||||
configure_interfaces
|
||||
|
||||
Reference in New Issue
Block a user