Reduce the block levels in define_firewall()

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2012-11-30 08:46:49 -08:00
parent 53fd0e7c8c
commit 893d054cb8

View File

@ -469,46 +469,46 @@ EOF
emit<<"EOF"; emit<<"EOF";
set_state Started $config_dir set_state Started $config_dir
run_restored_exit run_restored_exit
else elif [ \$COMMAND = refresh ]; then
if [ \$COMMAND = refresh ]; then chainlist_reload
chainlist_reload
EOF EOF
push_indent(2); push_indent;
setup_load_distribution; setup_load_distribution;
setup_forwarding( $family , 0 ); setup_forwarding( $family , 0 );
pop_indent(2); pop_indent;
#
emit( ' run_refreshed_exit' , # Use a parameter list rather than 'here documents' to avoid an extra blank line
' do_iptables -N shorewall' , #
" set_state Started $config_dir" , emit(
' else' , ' run_refreshed_exit',
' setup_netfilter' ); ' do_iptables -N shorewall',
" set_state Started $config_dir",
push_indent(2); ' [ \$0 = \${VARDIR}/firewall ] || cp -f \$(my_pathname) \${VARDIR}/firewall',
'else',
' setup_netfilter'
);
push_indent;
setup_load_distribution; setup_load_distribution;
pop_indent(2); pop_indent;
emit<<"EOF"; emit<<'EOF';
conditionally_flush_conntrack conditionally_flush_conntrack
EOF EOF
push_indent(2); push_indent;
initialize_switches; initialize_switches;
setup_forwarding( $family , 0 ); setup_forwarding( $family , 0 );
pop_indent(2); pop_indent;
emit<<"EOF"; emit<<"EOF";
run_start_exit run_start_exit
do_iptables -N shorewall do_iptables -N shorewall
set_state Started $config_dir set_state Started $config_dir
run_started_exit [ \$0 = \${VARDIR}/firewall ] || cp -f \$(my_pathname) \${VARDIR}/firewall
fi run_started_exit
fi
EOF EOF
emit<<'EOF'; emit<<'EOF';
[ $0 = ${VARDIR}/firewall ] || cp -f $(my_pathname) ${VARDIR}/firewall
fi
date > ${VARDIR}/restarted date > ${VARDIR}/restarted
case $COMMAND in case $COMMAND in