From 1e2192ab2d616aedc91538c4585328a4fd225803 Mon Sep 17 00:00:00 2001 From: teastep Date: Sat, 17 Mar 2007 16:54:39 +0000 Subject: [PATCH] Acknowledge that restart/refresh/restore are all the same now git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5562 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- New/compiler.pl | 40 +++++++++++++++++----------------------- New/prog.footer | 4 ++-- 2 files changed, 19 insertions(+), 25 deletions(-) diff --git a/New/compiler.pl b/New/compiler.pl index dec0f1fd6..fc051fb13 100755 --- a/New/compiler.pl +++ b/New/compiler.pl @@ -512,19 +512,25 @@ sub generate_script_3() { emit_unindented '__EOF__'; - emit_as_is " - if [ \$COMMAND = restore ]; then - iptables-restore < \$restore_file - fi\n"; + pop_indent; - emit 'date > ${VARDIR}/restarted'; - - append_file 'start'; + emit "}/n"; - emit 'set_state "Started"'; + progress_message2 "Creating iptables-restore input..."; + create_netfilter_load; - emit ' - cp -f $(my_pathname) ${VARDIR}/.restore + emit "#\n# Start/Restart the Firewall\n#"; + emit 'define_firewall() {'; + emit ' setup_routing_and_traffic_shaping;'; + emit ' setup_netfilter'; + emit ' restore_dynamic_rules'; + emit ' date > ${VARDIR}/restarted'; + emit ' run_start_exit'; + emit ' run_iptables -N shorewall'; + emit ' set_state "Started"'; + emit ' run_started_exit'; + emit ''; + emit ' cp -f $(my_pathname) ${VARDIR}/.restore case \$COMMAND in start) @@ -536,20 +542,8 @@ sub generate_script_3() { restore) logger -p kern.info "$PRODUCT restored" ;; - esac + 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 ' restore_dynamic_rules'; - emit ' run_iptables -N shorewall'; - emit ' run_started_exit'; emit "}\n"; copy find_file 'prog.footer'; diff --git a/New/prog.footer b/New/prog.footer index a92846bb1..be97739a7 100644 --- a/New/prog.footer +++ b/New/prog.footer @@ -114,7 +114,7 @@ case "$COMMAND" in refresh) if shorewall_is_started; then progress_message3 "Refreshing $PRODUCT...." - refresh_firewall + define_firewalll status=$? progress_message3 "done." else @@ -123,7 +123,7 @@ case "$COMMAND" in fi ;; restore) - restore_firewall + define_firewall status=$? if [ -n "$SUBSYSLOCK" ]; then [ $status -eq 0 ] && touch $SUBSYSLOCK || rm -f $SUBSYSLOCK