mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-16 11:20:53 +01:00
Add some more details at the end of the generated script's main function
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5561 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
637899177b
commit
3fedb6a7b6
@ -503,17 +503,53 @@ sub generate_script_2 () {
|
||||
}
|
||||
|
||||
sub generate_script_3() {
|
||||
pop_indent;
|
||||
|
||||
emit "}\n";
|
||||
emit 'cat > ${VARDIR}/proxyarp << __EOF__';
|
||||
|
||||
for $line ( @proxyarp ) {
|
||||
emit_unindented $line;
|
||||
}
|
||||
|
||||
emit_unindented '__EOF__';
|
||||
|
||||
emit_as_is "
|
||||
if [ \$COMMAND = restore ]; then
|
||||
iptables-restore < \$restore_file
|
||||
fi\n";
|
||||
|
||||
emit 'date > ${VARDIR}/restarted';
|
||||
|
||||
append_file 'start';
|
||||
|
||||
emit 'set_state "Started"';
|
||||
|
||||
emit '
|
||||
cp -f $(my_pathname) ${VARDIR}/.restore
|
||||
|
||||
case \$COMMAND in
|
||||
start)
|
||||
logger -p kern.info "$PRODUCT started"
|
||||
;;
|
||||
restart)
|
||||
logger -p kern.info "$PRODUCT restarted"
|
||||
;;
|
||||
restore)
|
||||
logger -p kern.info "$PRODUCT restored"
|
||||
;;
|
||||
esac
|
||||
|
||||
}
|
||||
';
|
||||
|
||||
progress_message2 "Creating iptables-restore input...";
|
||||
create_netfilter_load;
|
||||
emit "#\n# Start/Restart the Firewall\n#";
|
||||
emit 'define_firewall() {';
|
||||
emit ' setup_routing_and_traffic_shaping;';
|
||||
emit ' setup_netfilter';
|
||||
emit ' [ $COMMAND = restore ] || restore_dynamic_rules';
|
||||
emit ' restore_dynamic_rules';
|
||||
emit ' run_iptables -N shorewall';
|
||||
emit ' run_started_exit';
|
||||
emit "}\n";
|
||||
|
||||
copy find_file 'prog.footer';
|
||||
@ -669,7 +705,9 @@ sub compile_firewall( $ ) {
|
||||
progress_message2 "Setting UP Accounting...";
|
||||
setup_accounting;
|
||||
|
||||
unless ( $command eq 'check' ) {
|
||||
if ( $command eq 'check' ) {
|
||||
progress_message3 "Shorewall configuration verified";
|
||||
} else {
|
||||
#
|
||||
# Finish the script.
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user