Clamp VERBOSITY to valid range

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2010-10-01 13:56:44 -07:00
parent 50f06ff80e
commit 2c10d4b8f9
2 changed files with 12 additions and 0 deletions

View File

@ -145,6 +145,12 @@ get_config() {
[ -n "$g_use_verbosity" ] && VERBOSITY=$g_use_verbosity || VERBOSITY=$(($g_verbose_offset + $VERBOSITY))
if [ $VERBOSITY -lt -1 ]; then
VERBOSITY=-1
elif [ $VERBOSITY -gt 2 ]; then
VERBOSITY=2
fi
g_hostname=$(hostname 2> /dev/null)
IP=$(mywhich ip 2> /dev/null)

View File

@ -145,6 +145,12 @@ get_config() {
[ -n "$g_use_verbosity" ] && VERBOSITY=$g_use_verbosity || VERBOSITY=$(($g_verbose_offset + $VERBOSITY))
if [ $VERBOSITY -lt -1 ]; then
VERBOSITY=-1
elif [ $VERBOSITY -gt 2 ]; then
VERBOSITY=2
fi
g_hostname=$(hostname 2> /dev/null)
IP=$(mywhich ip 2> /dev/null)