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
This commit is contained in:
teastep 2009-01-16 20:51:55 +00:00
parent 194d34951b
commit 790b9dfa21

View File

@ -643,29 +643,6 @@ sub generate_script_2 () {
push_indent; 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 ) { if ( $family == F_IPV4 ) {
for my $interface ( @{find_interfaces_by_option 'norfc1918'} ) { for my $interface ( @{find_interfaces_by_option 'norfc1918'} ) {
emit ( "addr=\$(ip -f inet addr show $interface 2> /dev/null | grep 'inet\ ' | head -n1)", 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() {'; emit 'define_firewall() {';
push_indent; 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"; emit "\nclear_routing_and_traffic_shaping";
set_global_variables; set_global_variables;