/usr/share/fwbuilder-5.1.0.3599/configlets/linux24/script_skeleton is in fwbuilder-common 5.1.0-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | ## -*- mode: shell-script; -*-
##
## Double '##' comments are removed when configlet is processed.
## Single '#' comments stay.
##
## Some shells (not bash) do not like empty functions. Placing a comment
## inside the function does not help. Using dummy ":" as a placeholder.
##
{{$top_comment}}
{{$errors_and_warnings}}
{{$shell_debug}}
FWBDEBUG=""
{{$path}}
{{$constants}}
{{$tools}}
{{$shell_functions}}
{{$run_time_address_tables}}
load_modules() {
:
{{$load_modules}}
}
verify_interfaces() {
:
{{$verify_interfaces}}
}
prolog_commands() {
echo "Running prolog script"
{{$prolog_script}}
}
epilog_commands() {
echo "Running epilog script"
{{$epilog_script}}
}
run_epilog_and_exit() {
epilog_commands
exit $1
}
configure_interfaces() {
:
{{$configure_interfaces}}
}
script_body() {
{{$script_body}}
}
ip_forward() {
:
{{$ip_forward_commands}}
}
reset_all() {
:
{{$reset_all}}
}
{{$block_action}}
{{$stop_action}}
{{$status_action}}
# See how we were called.
# For backwards compatibility missing argument is equivalent to 'start'
cmd=$1
test -z "$cmd" && {
cmd="start"
}
case "$cmd" in
start)
log "Activating firewall script generated {{$timestamp}} by {{$user}}"
check_tools
{{if prolog_top}} prolog_commands {{endif}}
check_run_time_address_table_files
{{if using_ipset}}
check_module_ipset
load_run_time_address_table_files
{{endif}}
load_modules "{{$load_modules_with_nat}} {{$load_modules_with_ipv6}}"
configure_interfaces
verify_interfaces
{{if prolog_after_interfaces}} prolog_commands {{endif}}
{{if not_using_iptables_restore}} reset_all {{endif}}
{{if prolog_after_flush}} prolog_commands {{endif}}
script_body
ip_forward
epilog_commands
RETVAL=$?
;;
stop)
stop_action
RETVAL=$?
;;
status)
status_action
RETVAL=$?
;;
block)
block_action
RETVAL=$?
;;
reload)
$0 stop
$0 start
RETVAL=$?
;;
interfaces)
configure_interfaces
RETVAL=$?
;;
test_interfaces)
FWBDEBUG="echo"
configure_interfaces
RETVAL=$?
;;
{{if using_ipset}}
## Usage: script.fw reload_address_table <address_table_name> <file_name>
reload_address_table)
reload_address_table $2 $3
;;
## Usage: script.fw add_to_address_table <address_table_name> <file_name> <address>
add_to_address_table)
add_to_address_table $2 $3 $4
;;
## Usage: script.fw remove_from_address_table <address_table_name> <file_name> <address>
remove_from_address_table)
remove_from_address_table $2 $3 $4
;;
## Usage: script.fw test_address_table <address_table_name> <address>
test_address_table)
test_address_table $2 $3
;;
{{endif}}
*)
echo "Usage $0 [start|stop|status|block|reload|interfaces|test_interfaces{{if using_ipset}}|reload_address_table|add_to_address_table|remove_from_address_table|test_address_table{{endif}}]"
;;
esac
exit $RETVAL
|