mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-25 07:38:57 +01:00
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:
parent
194d34951b
commit
790b9dfa21
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user