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
This commit is contained in:
teastep 2007-03-17 16:54:39 +00:00
parent 3fedb6a7b6
commit 1e2192ab2d
2 changed files with 19 additions and 25 deletions

View File

@ -512,19 +512,25 @@ sub generate_script_3() {
emit_unindented '__EOF__'; emit_unindented '__EOF__';
emit_as_is " pop_indent;
if [ \$COMMAND = restore ]; then
iptables-restore < \$restore_file
fi\n";
emit 'date > ${VARDIR}/restarted'; emit "}/n";
append_file 'start'; progress_message2 "Creating iptables-restore input...";
create_netfilter_load;
emit 'set_state "Started"'; emit "#\n# Start/Restart the Firewall\n#";
emit 'define_firewall() {';
emit ' emit ' setup_routing_and_traffic_shaping;';
cp -f $(my_pathname) ${VARDIR}/.restore 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 case \$COMMAND in
start) start)
@ -536,20 +542,8 @@ sub generate_script_3() {
restore) restore)
logger -p kern.info "$PRODUCT restored" 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"; emit "}\n";
copy find_file 'prog.footer'; copy find_file 'prog.footer';

View File

@ -114,7 +114,7 @@ case "$COMMAND" in
refresh) refresh)
if shorewall_is_started; then if shorewall_is_started; then
progress_message3 "Refreshing $PRODUCT...." progress_message3 "Refreshing $PRODUCT...."
refresh_firewall define_firewalll
status=$? status=$?
progress_message3 "done." progress_message3 "done."
else else
@ -123,7 +123,7 @@ case "$COMMAND" in
fi fi
;; ;;
restore) restore)
restore_firewall define_firewall
status=$? status=$?
if [ -n "$SUBSYSLOCK" ]; then if [ -n "$SUBSYSLOCK" ]; then
[ $status -eq 0 ] && touch $SUBSYSLOCK || rm -f $SUBSYSLOCK [ $status -eq 0 ] && touch $SUBSYSLOCK || rm -f $SUBSYSLOCK