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:
teastep 2007-05-08 21:23:18 +00:00
parent 95c4bec713
commit e131aef733
2 changed files with 7 additions and 20 deletions

View File

@ -1721,36 +1721,21 @@ sub emitr( $ ) {
#
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.
#
for ( values %interfaceaddr ) {
emit $_;
$nonempty = 1;
}
for ( values %interfaceaddrs ) {
emit $_;
$nonempty = 1;
}
for ( values %interfacenets ) {
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
#
emitj( ' exec 3>&-',
emitj( 'exec 3>&-',
'',
'progress_message2 "Running iptables-restore..."',
'',

View File

@ -577,8 +577,6 @@ sub generate_script_3() {
emit "}\n";
set_global_variables;
progress_message2 "Creating iptables-restore input...";
create_netfilter_load;
@ -586,9 +584,13 @@ sub generate_script_3() {
emit 'define_firewall() {';
push_indent;
emit<<'EOF';
emit '';
set_global_variables;
set_global_variables;
emit '';
emit<<'EOF';
setup_routing_and_traffic_shaping;