diff --git a/Shorewall/Perl/Shorewall/Compiler.pm b/Shorewall/Perl/Shorewall/Compiler.pm index df9b51f99..5e50cf4f1 100644 --- a/Shorewall/Perl/Shorewall/Compiler.pm +++ b/Shorewall/Perl/Shorewall/Compiler.pm @@ -77,11 +77,11 @@ sub initialize_package_globals() { # sub generate_script_1() { - my $date = localtime; - if ( $test ) { emit "#!/bin/sh\n#\n# Compiled firewall script generated by Shorewall-perl\n#"; } else { + my $date = localtime; + emit "#!/bin/sh\n#\n# Compiled firewall script generated by Shorewall $globals{VERSION} - $date\n#"; if ( $family == F_IPV4 ) { copy $globals{SHAREDIRPL} . 'prog.header'; @@ -596,10 +596,10 @@ sub compiler { require_capability( 'XCONNMARK' , 'HIGH_ROUTE_MARKS=Yes' , 's' ) if $config{HIGH_ROUTE_MARKS}; require_capability( 'MANGLE_ENABLED' , 'Traffic Shaping' , 's' ) if $config{TC_ENABLED}; - set_command( 'check', 'Checking', 'Checked' ) unless $objectfile; - - unless ( $command eq 'check' ) { + if ( $objectfile ) { create_temp_object( $objectfile , $export ); + } else { + set_command( 'check', 'Checking', 'Checked' ); } # @@ -640,7 +640,7 @@ sub compiler { enable_object; - unless ( $command eq 'check' ) { + if ( $objectfile ) { # # Place Header in the object # @@ -680,7 +680,7 @@ sub compiler { # setup_zone_mss; - unless ( $command eq 'check' ) { + if ( $objectfile ) { emit 'return 0'; pop_indent; emit '}'; @@ -693,8 +693,7 @@ sub compiler { # enable_object; - unless ( $command eq 'check' ) { - + if ( $objectfile ) { emit( "\n#", '# Setup routing and traffic shaping', '#', @@ -712,7 +711,7 @@ sub compiler { # setup_tc; - unless ( $command eq 'check' ) { + if ( $objectfile ) { pop_indent; emit "}\n"; } @@ -773,15 +772,9 @@ sub compiler { # setup_accounting; - if ( $command eq 'check' ) { - if ( $family == F_IPV4 ) { - progress_message3 "Shorewall configuration verified"; - } else { - progress_message3 "Shorewall6 configuration verified"; - } - } else { + if ( $objectfile ) { # - # Generate the zone x zone matrix + # Generate the zone by zone matrix # generate_matrix; @@ -824,6 +817,12 @@ sub compiler { # And generate the auxilary config file # enable_object, generate_aux_config if $export; + } else { + if ( $family == F_IPV4 ) { + progress_message3 "Shorewall configuration verified"; + } else { + progress_message3 "Shorewall6 configuration verified"; + } } close_log if $log;