From 790b9dfa21afde224689b26f7774672378ee349b Mon Sep 17 00:00:00 2001 From: teastep Date: Fri, 16 Jan 2009 20:51:55 +0000 Subject: [PATCH] First baby step in reorganizing the compiled script git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@9291 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-perl/Shorewall/Compiler.pm | 46 ++++++++++++++-------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/Shorewall-perl/Shorewall/Compiler.pm b/Shorewall-perl/Shorewall/Compiler.pm index cfc59e867..12e4612bc 100644 --- a/Shorewall-perl/Shorewall/Compiler.pm +++ b/Shorewall-perl/Shorewall/Compiler.pm @@ -643,29 +643,6 @@ sub generate_script_2 () { push_indent; - save_progress_message 'Initializing...'; - - if ( $export ) { - my $fn = find_file 'modules'; - - if ( $fn ne "$globals{SHAREDIR}/modules" && -f $fn ) { - emit 'echo MODULESDIR="$MODULESDIR" > ${VARDIR}/.modulesdir'; - emit 'cat > ${VARDIR}/.modules << EOF'; - open_file $fn; - while ( read_a_line ) { - emit_unindented $currentline; - } - emit_unindented 'EOF'; - emit 'reload_kernel_modules < ${VARDIR}/.modules'; - } else { - emit 'load_kernel_modules Yes'; - } - } else { - emit 'load_kernel_modules Yes'; - } - - emit ''; - if ( $family == F_IPV4 ) { for my $interface ( @{find_interfaces_by_option 'norfc1918'} ) { emit ( "addr=\$(ip -f inet addr show $interface 2> /dev/null | grep 'inet\ ' | head -n1)", @@ -776,6 +753,29 @@ sub generate_script_3($) { emit 'define_firewall() {'; push_indent; + save_progress_message 'Initializing...'; + + if ( $export ) { + my $fn = find_file 'modules'; + + if ( $fn ne "$globals{SHAREDIR}/modules" && -f $fn ) { + emit 'echo MODULESDIR="$MODULESDIR" > ${VARDIR}/.modulesdir'; + emit 'cat > ${VARDIR}/.modules << EOF'; + open_file $fn; + while ( read_a_line ) { + emit_unindented $currentline; + } + emit_unindented 'EOF'; + emit 'reload_kernel_modules < ${VARDIR}/.modules'; + } else { + emit 'load_kernel_modules Yes'; + } + } else { + emit 'load_kernel_modules Yes'; + } + + emit ''; + emit "\nclear_routing_and_traffic_shaping"; set_global_variables;