De-implement 'close'

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2010-05-16 15:31:41 -07:00
parent 749d6be64e
commit 4f428d8135
4 changed files with 10 additions and 34 deletions

View File

@ -2240,7 +2240,7 @@ EOF
}
case $COMMAND in
stop|close|clear|restore)
stop|clear|restore)
;;
*)
set +x
@ -2446,18 +2446,12 @@ EOF
emit '
if [ "$COMMAND" != close ]; then
set_state "Stopped"
logger -p kern.info "$g_product Stopped"
fi
set_state "Stopped"
logger -p kern.info "$g_product Stopped"
case $COMMAND in
stop|clear)
;;
close)
set_state "Closed"
logger -p kern.info "$g_product Closed"
;;
*)
#
# The firewall is being stopped when we were trying to do something

View File

@ -1249,7 +1249,7 @@ sub compile_updown() {
' state=started',
'elif [ -f ${VARDIR}/state ]; then',
' case "$(cat ${VARDIR}/state)" in',
' Stopped*|Closed*)',
' Stopped*)',
' state=stopped',
' ;;',
' Cleared*)',
@ -1294,7 +1294,7 @@ sub compile_updown() {
' detect_configuration',
' define_firewall',
' else',
' COMMAND=close',
' COMMAND=stop',
' detect_configuration',
' stop_firewall',
' fi',
@ -1331,7 +1331,7 @@ sub compile_updown() {
' define_firewall',
' ;;',
' cleared|unknown)',
' COMMAND=close',
' COMMAND=stop',
' detect_configuration',
' stop_firewall',
' ;;',

View File

@ -5,7 +5,7 @@
# Give Usage Information
#
usage() {
echo "Usage: $0 [ options ] [ start|stop|close|clear|down|reset|refresh|restart|status|up|version ]"
echo "Usage: $0 [ options ] [ start|stop|clear|down|reset|refresh|restart|status|up|version ]"
echo
echo "Options are:"
echo
@ -182,15 +182,6 @@ case "$COMMAND" in
[ -n "$SUBSYSLOCK" ] && rm -f $SUBSYSLOCK
progress_message3 "done."
;;
close)
[ $# -ne 1 ] && usage 2
progress_message3 "Closing $g_product...."
detect_configuration
stop_firewall
status=0
[ -n "$SUBSYSLOCK" ] && touch ${SUBSYSLOCK}-prenet
progress_message3 "done."
;;
reset)
if ! shorewall_is_started ; then
error_message "$g_product is not running"
@ -285,7 +276,7 @@ case "$COMMAND" in
if [ -f ${VARDIR}/state ]; then
state="$(cat ${VARDIR}/state)"
case $state in
Stopped*|Closed*|lClear*)
Stopped*|lClear*)
status=3
;;
esac

View File

@ -5,7 +5,7 @@
# Give Usage Information
#
usage() {
echo "Usage: $0 [ options ] [ start|stop|close|clear|down|reset|refresh|restart|status|up|version ]"
echo "Usage: $0 [ options ] [ start|stop|clear|down|reset|refresh|restart|status|up|version ]"
echo
echo "Options are:"
echo
@ -184,15 +184,6 @@ else
[ -n "$SUBSYSLOCK" ] && rm -f $SUBSYSLOCK
progress_message3 "done."
;;
close)
[ $# -ne 1 ] && usage 2
progress_message3 "Closing $g_product...."
detect_configuration
stop_firewall
status=0
[ -n "$SUBSYSLOCK" ] && touch ${SUBSYSLOCK}-prenet
progress_message3 "done."
;;
reset)
if ! shorewall6_is_started ; then
error_message "$g_product is not running"
@ -286,7 +277,7 @@ else
if [ -f ${VARDIR}/state ]; then
state="$(cat ${VARDIR}/state)"
case $state in
Stopped*|Closed*|Clear*)
Stopped*|Clear*)
status=3
;;
esac