forked from extern/shorewall_code
reorganize run-time globals management
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6292 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
95c4bec713
commit
e131aef733
@ -1721,36 +1721,21 @@ sub emitr( $ ) {
|
|||||||
#
|
#
|
||||||
sub set_global_variables() {
|
sub set_global_variables() {
|
||||||
|
|
||||||
my $nonempty = 0;
|
|
||||||
|
|
||||||
emitj( 'set_global_variables()',
|
|
||||||
'{'
|
|
||||||
);
|
|
||||||
|
|
||||||
push_indent;
|
|
||||||
#
|
#
|
||||||
# Establish the values of shell variables used in the following shell commands and/or 'here documents' input.
|
# Establish the values of shell variables used in the following shell commands and/or 'here documents' input.
|
||||||
#
|
#
|
||||||
for ( values %interfaceaddr ) {
|
for ( values %interfaceaddr ) {
|
||||||
emit $_;
|
emit $_;
|
||||||
$nonempty = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( values %interfaceaddrs ) {
|
for ( values %interfaceaddrs ) {
|
||||||
emit $_;
|
emit $_;
|
||||||
$nonempty = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( values %interfacenets ) {
|
for ( values %interfacenets ) {
|
||||||
emit $_;
|
emit $_;
|
||||||
$nonempty = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
emit "true" unless $nonempty;
|
|
||||||
|
|
||||||
pop_indent;
|
|
||||||
|
|
||||||
emit "}\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -1818,7 +1803,7 @@ sub create_netfilter_load() {
|
|||||||
#
|
#
|
||||||
# Now generate the actual iptabes-restore command
|
# Now generate the actual iptabes-restore command
|
||||||
#
|
#
|
||||||
emitj( ' exec 3>&-',
|
emitj( 'exec 3>&-',
|
||||||
'',
|
'',
|
||||||
'progress_message2 "Running iptables-restore..."',
|
'progress_message2 "Running iptables-restore..."',
|
||||||
'',
|
'',
|
||||||
|
@ -577,8 +577,6 @@ sub generate_script_3() {
|
|||||||
|
|
||||||
emit "}\n";
|
emit "}\n";
|
||||||
|
|
||||||
set_global_variables;
|
|
||||||
|
|
||||||
progress_message2 "Creating iptables-restore input...";
|
progress_message2 "Creating iptables-restore input...";
|
||||||
create_netfilter_load;
|
create_netfilter_load;
|
||||||
|
|
||||||
@ -586,9 +584,13 @@ sub generate_script_3() {
|
|||||||
emit 'define_firewall() {';
|
emit 'define_firewall() {';
|
||||||
push_indent;
|
push_indent;
|
||||||
|
|
||||||
emit<<'EOF';
|
emit '';
|
||||||
|
|
||||||
set_global_variables;
|
set_global_variables;
|
||||||
|
|
||||||
|
emit '';
|
||||||
|
|
||||||
|
emit<<'EOF';
|
||||||
|
|
||||||
setup_routing_and_traffic_shaping;
|
setup_routing_and_traffic_shaping;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user