Eliminate VERBOSE

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2010-02-28 17:58:01 -08:00
parent 14f83759ae
commit 53c73bc8e9
19 changed files with 61 additions and 56 deletions

View File

@ -59,7 +59,7 @@ VERSION=$(cat /usr/share/shorewall-lite/version)
[ -n "$IPTABLES" ] || IPTABLES=$(mywhich iptables)
VERBOSE=0
VERBOSITY=0
load_kernel_modules No
determine_capabilities
report_capabilities1

View File

@ -149,9 +149,9 @@ get_config() {
[ -n "${VERBOSITY:=2}" ]
[ -n "$g_use_verbosity" ] && VERBOSE=$g_use_verbosity || VERBOSE=$(($g_verbose_offset + $VERBOSITY))
[ -n "$g_use_verbosity" ] && VERBOSITY=$g_use_verbosity || VERBOSITY=$(($g_verbose_offset + $VERBOSITY))
export VERBOSE
export VERBOSITY
[ -n "${HOSTNAME:=$(hostname)}" ]

View File

@ -216,7 +216,7 @@ sub generate_script_2() {
my @dont_load = split_list $config{DONT_LOAD}, 'module';
emit ( '[ -n "${COMMAND:=restart}" ]',
'[ -n "${VERBOSE:=0}" ]',
'[ -n "${VERBOSITY:=0}" ]',
qq([ -n "\${RESTOREFILE:=$config{RESTOREFILE}}" ]) );
emit ( qq(VERSION="$globals{VERSION}") ) unless $test;

View File

@ -24,6 +24,8 @@ if [ $# -gt 1 ]; then
fi
fi
[ -z "$VERBOSITY" ] && [ -n "$VERBOSE" ] & VERBOSITY=$VERBOSE
initialize
if [ -n "$STARTUP_LOG" ]; then
@ -51,11 +53,11 @@ while [ $finished -eq 0 -a $# -gt 0 ]; do
while [ -n "$option" ]; do
case $option in
v*)
VERBOSE=$(($VERBOSE + 1 ))
VERBOSITY=$(($VERBOSITY + 1 ))
option=${option#v}
;;
q*)
VERBOSE=$(($VERBOSE - 1 ))
VERBOSITY=$(($VERBOSITY - 1 ))
option=${option#q}
;;
n*)
@ -81,7 +83,7 @@ while [ $finished -eq 0 -a $# -gt 0 ]; do
if [ -n "$option" ]; then
case $option in
-1|0|1|2)
VERBOSE=$option
VERBOSITY=$option
option=
;;
*)

View File

@ -24,6 +24,8 @@ if [ $# -gt 1 ]; then
fi
fi
[ -z "$VERBOSITY" ] && [ -n "$VERBOSE" ] & VERBOSITY=$VERBOSE
initialize
if [ -n "$STARTUP_LOG" ]; then
@ -51,11 +53,11 @@ while [ $finished -eq 0 -a $# -gt 0 ]; do
while [ -n "$option" ]; do
case $option in
v*)
VERBOSE=$(($VERBOSE + 1 ))
VERBOSITY=$(($VERBOSITY + 1 ))
option=${option#v}
;;
q*)
VERBOSE=$(($VERBOSE - 1 ))
VERBOSITY=$(($VERBOSITY - 1 ))
option=${option#q}
;;
n*)
@ -81,7 +83,7 @@ while [ $finished -eq 0 -a $# -gt 0 ]; do
if [ -n "$option" ]; then
case $option in
-1|0|1|2)
VERBOSE=$option
VERBOSITY=$option
option=
;;
*)

View File

@ -38,7 +38,7 @@ progress_message() # $* = Message
local timestamp
timestamp=
if [ $VERBOSE -gt 1 ]; then
if [ $VERBOSITY -gt 1 ]; then
[ -n "$TIMESTAMP" ] && timestamp="$(date +%H:%M:%S) "
echo "${timestamp}$@"
fi
@ -54,7 +54,7 @@ progress_message2() # $* = Message
local timestamp
timestamp=
if [ $VERBOSE -gt 0 ]; then
if [ $VERBOSITY -gt 0 ]; then
[ -n "$TIMESTAMP" ] && timestamp="$(date +%H:%M:%S) "
echo "${timestamp}$@"
fi
@ -70,7 +70,7 @@ progress_message3() # $* = Message
local timestamp
timestamp=
if [ $VERBOSE -ge 0 ]; then
if [ $VERBOSITY -ge 0 ]; then
[ -n "$TIMESTAMP" ] && timestamp="$(date +%H:%M:%S) "
echo "${timestamp}$@"
fi

View File

@ -38,7 +38,7 @@ progress_message() # $* = Message
local timestamp
timestamp=
if [ $VERBOSE -gt 1 ]; then
if [ $VERBOSITY -gt 1 ]; then
[ -n "$TIMESTAMP" ] && timestamp="$(date +%H:%M:%S) "
echo "${timestamp}$@"
fi
@ -54,7 +54,7 @@ progress_message2() # $* = Message
local timestamp
timestamp=
if [ $VERBOSE -gt 0 ]; then
if [ $VERBOSITY -gt 0 ]; then
[ -n "$TIMESTAMP" ] && timestamp="$(date +%H:%M:%S) "
echo "${timestamp}$@"
fi
@ -70,7 +70,7 @@ progress_message3() # $* = Message
local timestamp
timestamp=
if [ $VERBOSE -ge 0 ]; then
if [ $VERBOSITY -ge 0 ]; then
[ -n "$TIMESTAMP" ] && timestamp="$(date +%H:%M:%S) "
echo "${timestamp}$@"
fi

View File

@ -52,7 +52,7 @@ progress_message() # $* = Message
local timestamp
timestamp=
if [ $VERBOSE -gt 1 ]; then
if [ $VERBOSITY -gt 1 ]; then
[ -n "$TIMESTAMP" ] && timestamp="$(date +%H:%M:%S) "
echo "${timestamp}$@"
fi
@ -63,7 +63,7 @@ progress_message2() # $* = Message
local timestamp
timestamp=
if [ $VERBOSE -gt 0 ]; then
if [ $VERBOSITY -gt 0 ]; then
[ -n "$TIMESTAMP" ] && timestamp="$(date +%H:%M:%S) "
echo "${timestamp}$@"
fi
@ -74,7 +74,7 @@ progress_message3() # $* = Message
local timestamp
timestamp=
if [ $VERBOSE -ge 0 ]; then
if [ $VERBOSITY -ge 0 ]; then
[ -n "$TIMESTAMP" ] && timestamp="$(date +%H:%M:%S) "
echo "${timestamp}$@"
fi
@ -990,7 +990,7 @@ report_capabilities() {
echo " " $1: $setting
}
if [ $VERBOSE -gt 1 ]; then
if [ $VERBOSITY -gt 1 ]; then
echo "Shorewall has detected the following iptables/netfilter capabilities:"
report_capability "NAT" $NAT_ENABLED
report_capability "Packet Mangling" $MANGLE_ENABLED

View File

@ -151,7 +151,7 @@ syslog_circular_buffer() {
#
packet_log() # $1 = number of messages
{
if [ -n "$g_showmacs" -o $VERBOSE -gt 2 ]; then
if [ -n "$g_showmacs" -o $VERBOSITY -gt 2 ]; then
$g_logread | grep 'IN=.* OUT=.*SRC=.*\..*DST=' | head -n$1 | tac | sed 's/ kernel://; s/\[.*\] //' | sed s/" $host $LOGFORMAT"/" "/
else
$g_logread | grep 'IN=.* OUT=.*SRC=.*\..*DST=' | head -n$1 | tac | sed 's/ kernel://; s/MAC=.* SRC=/SRC=/; s/\[.*\] '// | sed s/" $host $LOGFORMAT"/" "/
@ -458,7 +458,7 @@ show_command() {
option=
;;
v*)
VERBOSE=$(($VERBOSE + 1 ))
VERBOSITY=$(($VERBOSITY + 1 ))
option=${option#v}
;;
x*)
@ -587,7 +587,7 @@ show_command() {
capabilities)
[ $# -gt 1 ] && usage 1
determine_capabilities
VERBOSE=2
VERBOSITY=2
if [ -n "$g_filemode" ]; then
report_capabilities1
else
@ -778,7 +778,7 @@ dump_command() {
g_ipt_options="$g_ipt_options $g_ipt_options1"
[ $VERBOSE -lt 2 ] && VERBOSE=2
[ $VERBOSITY -lt 2 ] && VERBOSITY=2
[ -n "$g_debugging" ] && set -x
[ $# -eq 0 ] || usage 1
@ -1390,11 +1390,11 @@ logwatch_command() {
while [ -n "$option" ]; do
case $option in
v*)
VERBOSE=$(($VERBOSE + 1 ))
VERBOSITY=$(($VERBOSITY + 1 ))
option=${option#v}
;;
q*)
VERBOSE=$(($VERBOSE - 1 ))
VERBOSITY=$(($VERBOSITY - 1 ))
option=${option#q}
;;
m*)

View File

@ -297,6 +297,7 @@ None.
RING_BELL
TEST
USE_VERBOSITY
VERBOSE
VERBOSE_OFFSET
See Migration Issue 14 above for additional information.

View File

@ -259,15 +259,15 @@ get_config() {
;;
esac
[ -n "$g_use_verbosity" ] && VERBOSE=$g_use_verbosity || VERBOSE=$(($g_verbose_offset + $VERBOSITY))
[ -n "$g_use_verbosity" ] && VERBOSITY=$g_use_verbosity || VERBOSITY=$(($g_verbose_offset + $VERBOSITY))
if [ $VERBOSE -lt -1 ]; then
VERBOSE=-1
elif [ $VERBOSE -gt 2 ]; then
VERBOSE=2
if [ $VERBOSITY -lt -1 ]; then
VERBOSITY=-1
elif [ $VERBOSITY -gt 2 ]; then
VERBOSITY=2
fi
export VERBOSE
export VERBOSITY
[ -n "${HOSTNAME:=$(hostname)}" ]
@ -355,7 +355,7 @@ compiler() {
[ "$1" = nolock ] && shift;
shift
options="--verbose=$VERBOSE"
options="--verbose=$VERBOSITY"
[ -n "$STARTUP_LOG" ] && options="$options --log=$STARTUP_LOG"
[ -n "$LOG_VERBOSITY" ] && options="$options --log_verbosity=$LOG_VERBOSITY";
[ -n "$g_export" ] && options="$options --export"

View File

@ -59,7 +59,7 @@ VERSION=$(cat /usr/share/shorewall6-lite/version)
[ -n "$IPTABLES" ] || IPTABLES=$(mywhich iptables)
VERBOSE=0
VERBOSITY=0
load_kernel_modules No
determine_capabilities
report_capabilities1

View File

@ -149,9 +149,9 @@ get_config() {
[ -n "${VERBOSITY:=2}" ]
[ -n "$g_use_verbosity" ] && VERBOSE=$g_use_verbosity || VERBOSE=$(($g_verbose_offset + $VERBOSITY))
[ -n "$g_use_verbosity" ] && VERBOSITY=$g_use_verbosity || VERBOSITY=$(($g_verbose_offset + $VERBOSITY))
export VERBOSE
export VERBOSITY
[ -n "${HOSTNAME:=$(hostname)}" ]

View File

@ -56,7 +56,7 @@ progress_message() # $* = Message
local timestamp
timestamp=
if [ $VERBOSE -gt 1 ]; then
if [ $VERBOSITY -gt 1 ]; then
[ -n "$TIMESTAMP" ] && timestamp="$(date +%H:%M:%S) "
echo "${timestamp}$@"
fi
@ -67,7 +67,7 @@ progress_message2() # $* = Message
local timestamp
timestamp=
if [ $VERBOSE -gt 0 ]; then
if [ $VERBOSITY -gt 0 ]; then
[ -n "$TIMESTAMP" ] && timestamp="$(date +%H:%M:%S) "
echo "${timestamp}$@"
fi
@ -78,7 +78,7 @@ progress_message3() # $* = Message
local timestamp
timestamp=
if [ $VERBOSE -ge 0 ]; then
if [ $VERBOSITY -ge 0 ]; then
[ -n "$TIMESTAMP" ] && timestamp="$(date +%H:%M:%S) "
echo "${timestamp}$@"
fi
@ -897,7 +897,7 @@ report_capabilities() {
echo " " $1: $setting
}
if [ $VERBOSE -gt 1 ]; then
if [ $VERBOSITY -gt 1 ]; then
echo "Shorewall6 has detected the following ip6tables/netfilter capabilities:"
report_capability "Packet Mangling" $MANGLE_ENABLED
report_capability "Multi-port Match" $MULTIPORT

View File

@ -132,7 +132,7 @@ syslog_circular_buffer() {
#
packet_log() # $1 = number of messages
{
if [ -n "$g_showmacs" -o $VERBOSE -gt 2 ]; then
if [ -n "$g_showmacs" -o $VERBOSITY -gt 2 ]; then
$g_logread | grep 'IN=.* OUT=.*SRC=.*:.*DST=' | head -n$1 | tac | sed 's/ kernel://; s/\[.*\] //' | sed s/" $host $LOGFORMAT"/" "/
else
$g_logread | grep 'IN=.* OUT=.*SRC=.*:.*DST=' | head -n$1 | tac | sed 's/ kernel://; s/MAC=.* SRC=/SRC=/; s/\[.*\] '// | sed s/" $host $LOGFORMAT"/" "/
@ -371,7 +371,7 @@ show_command() {
option=
;;
v*)
VERBOSE=$(($VERBOSE + 1 ))
VERBOSITY=$(($VERBOSITY + 1 ))
option=${option#v}
;;
x*)
@ -492,7 +492,7 @@ show_command() {
capabilities)
[ $# -gt 1 ] && usage 1
determine_capabilities
VERBOSE=2
VERBOSITY=2
if [ -n "$g_filemode" ]; then
report_capabilities1
else
@ -654,7 +654,7 @@ dump_command() {
g_ipt_options="$g_ipt_options $g_ipt_options1"
[ $VERBOSE -lt 2 ] && VERBOSE=2
[ $VERBOSITY -lt 2 ] && VERBOSITY=2
[ -n "$g_debugging" ] && set -x
[ $# -eq 0 ] || usage 1
@ -1088,11 +1088,11 @@ logwatch_command() {
while [ -n "$option" ]; do
case $option in
v*)
VERBOSE=$(($VERBOSE + 1 ))
VERBOSITY=$(($VERBOSITY + 1 ))
option=${option#v}
;;
q*)
VERBOSE=$(($VERBOSE - 1 ))
VERBOSITY=$(($VERBOSITY - 1 ))
option=${option#q}
;;
m*)

View File

@ -178,15 +178,15 @@ get_config() {
;;
esac
[ -n "$g_use_verbosity" ] && VERBOSE=$g_use_verbosity || VERBOSE=$(($g_verbose_offset + $VERBOSITY))
[ -n "$g_use_verbosity" ] && VERBOSITY=$g_use_verbosity || VERBOSITY=$(($g_verbose_offset + $VERBOSITY))
if [ $VERBOSE -lt -1 ]; then
VERBOSE=-1
elif [ $VERBOSE -gt 2 ]; then
VERBOSE=2
if [ $VERBOSITY -lt -1 ]; then
VERBOSITY=-1
elif [ $VERBOSITY -gt 2 ]; then
VERBOSITY=2
fi
export VERBOSE
export VERBOSITY
[ -n "${HOSTNAME:=$(hostname)}" ]
@ -285,7 +285,7 @@ compiler() {
[ "$1" = nolock ] && shift;
shift
options="--verbose=$VERBOSE --family=6"
options="--verbose=$VERBOSITY --family=6"
[ -n "$STARTUP_LOG" ] && options="$options --log=$STARTUP_LOG"
[ -n "$LOG_VERBOSITY" ] && options="$options --log_verbosity=$LOG_VERBOSITY";
[ -n "$g_export" ] && options="$options --export"

View File

@ -666,7 +666,7 @@ SHELL cat /etc/shorewall/rules.d/*.rules</programlisting></para>
<member><emphasis role="bold">VARDIR</emphasis></member>
<member><emphasis role="bold">VERBOSE</emphasis></member>
<member>VERBOSE</member>
<member>VERBOSE_OFFSET</member>
</simplelist>

View File

@ -83,7 +83,7 @@
<member><emphasis role="bold">VARDIR</emphasis></member>
<member><emphasis role="bold">VERBOSE</emphasis></member>
<member>VERBOSE</member>
<member>VERBOSE_OFFSET</member>
</simplelist>

View File

@ -84,7 +84,7 @@
<member><emphasis role="bold">VARDIR</emphasis></member>
<member><emphasis role="bold">VERBOSE</emphasis></member>
<member>VERBOSE</member>
<member>VERBOSE_OFFSET</member>
</simplelist>