Correct several bugs in the VERBOSITY overhaul

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2010-03-01 06:57:04 -08:00
parent 53c73bc8e9
commit 3ba797cb14
3 changed files with 7 additions and 50 deletions

View File

@ -189,7 +189,7 @@ our %config;
#
# Config options and global settings that are to be copied to output script
#
our @propagateconfig = qw/ DISABLE_IPV6 MODULESDIR MODULE_SUFFIX LOAD_HELPERS_ONLY SUBSYSLOCK VERBOSITY LOG_VERBOSITY/;
our @propagateconfig = qw/ DISABLE_IPV6 MODULESDIR MODULE_SUFFIX LOAD_HELPERS_ONLY SUBSYSLOCK LOG_VERBOSITY/;
#
# From parsing the capabilities file or detecting capabilities
#

View File

@ -14,6 +14,8 @@ usage() {
#
# Start trace if first arg is "debug" or "trace"
#
[ -n "${PRODUCT:=Shorewall}" ]
if [ $# -gt 1 ]; then
if [ "x$1" = "xtrace" ]; then
set -x
@ -24,7 +26,7 @@ if [ $# -gt 1 ]; then
fi
fi
[ -z "$VERBOSITY" ] && [ -n "$VERBOSE" ] & VERBOSITY=$VERBOSE
[ -z "$VERBOSITY" ] && [ -n "$VERBOSE" ] && VERBOSITY=$VERBOSE
initialize
@ -109,8 +111,6 @@ done
COMMAND="$1"
[ -n "${PRODUCT:=Shorewall}" ]
case "$COMMAND" in
start)
[ $# -ne 1 ] && usage 2

View File

@ -14,6 +14,8 @@ usage() {
#
# Start trace if first arg is "debug" or "trace"
#
[ -n "${PRODUCT:=Shorewall6}" ]
if [ $# -gt 1 ]; then
if [ "x$1" = "xtrace" ]; then
set -x
@ -24,7 +26,7 @@ if [ $# -gt 1 ]; then
fi
fi
[ -z "$VERBOSITY" ] && [ -n "$VERBOSE" ] & VERBOSITY=$VERBOSE
[ -z "$VERBOSITY" ] && [ -n "$VERBOSE" ] && VERBOSITY=$VERBOSE
initialize
@ -106,51 +108,6 @@ done
COMMAND="$1"
[ -n "${PRODUCT:=Shorewall6}" ]
kernel=$(printf "%2d%02d%02d" $(uname -r 2> /dev/null | sed -e 's/-.*//' -e 's/^\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*$/\1 \2 \3/g'))
if [ $kernel -lt 20624 ]; then
error_message "ERROR: $PRODUCT requires Linux kernel 2.6.24 or later"
status=2
else
case "$COMMAND" in
start)
[ $# -ne 1 ] && usage 2
if shorewall6_is_started; then
error_message "$PRODUCT is already Running"
status=0
else
progress_message3 "Starting $PRODUCT...."
detect_configuration
define_firewall
status=$?
[ -n "$SUBSYSLOCK" -a $status -eq 0 ] && touch $SUBSYSLOCK
progress_message3 "done."
fi
;;
stop)
[ $# -ne 1 ] && usage 2
progress_message3 "Stopping $PRODUCT...."
detect_configuration
stop_firewall
status=0
[ -n "$SUBSYSLOCK" ] && rm -f $SUBSYSLOCK *)
usage 1
;;
esac
done
shift
;;
*)
finished=1
;;
esac
done
COMMAND="$1"
[ -n "${PRODUCT:=Shorewall6}" ]
kernel=$(printf "%2d%02d%02d" $(uname -r 2> /dev/null | sed -e 's/-.*//' -e 's/^\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*$/\1 \2 \3/g'))
if [ $kernel -lt 20624 ]; then
error_message "ERROR: $PRODUCT requires Linux kernel 2.6.24 or later"