mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-09-13 08:29:32 +02:00
fixes #949 rename shell function called when iptables runs with argument "stop"
This commit is contained in:
@@ -602,6 +602,9 @@ string CompilerDriver_ipt::run(const std::string &cluster_id,
|
||||
|
||||
script_buffer = "";
|
||||
|
||||
Configlet stop_action(fw, "linux24", "stop_action");
|
||||
script_skeleton.setVariable("stop_action", stop_action.expand());
|
||||
|
||||
Configlet top_comment(fw, "linux24", "top_comment");
|
||||
|
||||
top_comment.setVariable("version", VERSION);
|
||||
|
||||
@@ -65,6 +65,11 @@ reset_all() {
|
||||
{{$reset_all}}
|
||||
}
|
||||
|
||||
stop_action() {
|
||||
:
|
||||
{{$stop_action}}
|
||||
}
|
||||
|
||||
# See how we were called.
|
||||
# For backwards compatibility missing argument is equivalent to 'start'
|
||||
|
||||
@@ -90,7 +95,7 @@ case "$1" in
|
||||
;;
|
||||
|
||||
stop)
|
||||
reset_all
|
||||
stop_action
|
||||
;;
|
||||
|
||||
reload)
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
## -*- mode: shell-script; -*-
|
||||
##
|
||||
## To be able to make changes to the part of configuration created
|
||||
## from this configlet you need to copy this file to the directory
|
||||
## fwbuilder/configlets/sveasoft/ in your home directory and modify it.
|
||||
## Double "##" comments are removed during processing but single "#"
|
||||
## comments are be retained and appear in the generated script. Empty
|
||||
## lines are removed as well.
|
||||
##
|
||||
## Configlets support simple macro language with these constructs:
|
||||
## {{$var}} is variable expansion
|
||||
## {{if var}} is conditional operator.
|
||||
##
|
||||
## This configlet defines commands executed when iptables script is ran
|
||||
## with command line argument "stop". By default it resets iptables
|
||||
## tables and chains using function reset_all and optionally adds backup
|
||||
## ssh access rules.
|
||||
|
||||
reset_all
|
||||
|
||||
## it helps to add backup ssh access rule as early as possible so that
|
||||
## ssh session opened from the management station won't break after
|
||||
## all chains are flushed. The installation process may stall if
|
||||
## stdout buffer gets filled with diagnostic or progress output from
|
||||
## this script printed after chains are flushed but before a rule
|
||||
## permitting ssh is installed. This may happen if script debugging is
|
||||
## on or there are many NAT rules (so it prints a lot of "Rule NN
|
||||
## (NAT)" lines).
|
||||
|
||||
{{if mgmt_access}}
|
||||
# backup ssh access
|
||||
$IPTABLES INPUT -p tcp -m tcp -s {{$management_address}} --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT
|
||||
$IPTABLES OUTPUT -p tcp -m tcp -d {{$management_address}} --sport 22 -m state --state ESTABLISHED,RELATED -j ACCEPT
|
||||
{{endif}}
|
||||
|
||||
@@ -74,6 +74,11 @@ reset_all() {
|
||||
{{$reset_all}}
|
||||
}
|
||||
|
||||
stop_action() {
|
||||
:
|
||||
{{$stop_action}}
|
||||
}
|
||||
|
||||
# For backwards compatibility missing argument is equivalent to 'start'
|
||||
test -z "$1" && {
|
||||
$0 start
|
||||
@@ -97,7 +102,7 @@ case "$1" in
|
||||
;;
|
||||
|
||||
stop)
|
||||
reset_all
|
||||
stop_action
|
||||
;;
|
||||
|
||||
reload)
|
||||
|
||||
Reference in New Issue
Block a user