From 075d7ca68b90d52a11650493dc6f6426d338effa Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Mon, 19 Dec 2011 06:29:05 -0800 Subject: [PATCH] Rename $nolock to $g_nolock Signed-off-by: Tom Eastep --- Shorewall/lib.cli | 36 ++++++++++++++++++------------------ Shorewall/shorewall | 14 ++++++-------- 2 files changed, 24 insertions(+), 26 deletions(-) diff --git a/Shorewall/lib.cli b/Shorewall/lib.cli index 3249394c2..5a617810e 100644 --- a/Shorewall/lib.cli +++ b/Shorewall/lib.cli @@ -1251,17 +1251,17 @@ restore_command() { g_restorepath=${VARDIR}/$RESTOREFILE - [ -n "$nolock" ] || mutex_on + [ -n "$g_nolock" ] || mutex_on if [ -x $g_restorepath ]; then progress_message3 "Restoring $g_product..." run_it $g_restorepath restore && progress_message3 "$g_product restored from ${VARDIR}/$RESTOREFILE" - [ -n "$nolock" ] || mutex_off + [ -n "$g_nolock" ] || mutex_off else echo "File $g_restorepath: file not found" - [ -n "$nolock" ] || mutex_off + [ -n "$g_nolock" ] || mutex_off exit 2 fi } @@ -1357,7 +1357,7 @@ block() # $1 = command, $2 = Finished, $3 - $n addresses if ! chain_exists dynamic; then echo "Dynamic blacklisting is not enabled in the current $g_product configuration" >&2 - [ -n "$nolock" ] || mutex_off + [ -n "$g_nolock" ] || mutex_off exit 2 fi @@ -1706,7 +1706,7 @@ allow_command() { exit 2 fi - [ -n "$nolock" ] || mutex_on + [ -n "$g_nolock" ] || mutex_on while [ $# -gt 1 ]; do shift case $1 in @@ -1744,7 +1744,7 @@ allow_command() { ;; esac done - [ -n "$nolock" ] || mutex_off + [ -n "$g_nolock" ] || mutex_off else error_message "ERROR: $g_product is not started" exit 2 @@ -2322,9 +2322,9 @@ drop_command() { exit 2 fi - [ -n "$nolock" ] || mutex_on + [ -n "$g_nolock" ] || mutex_on block DROP Dropped $* - [ -n "$nolock" ] || mutex_off + [ -n "$g_nolock" ] || mutex_off else fatal_error "$g_product is not started" fi @@ -2337,9 +2337,9 @@ logdrop_command() { exit 2 fi - [ -n "$nolock" ] || mutex_on + [ -n "$g_nolock" ] || mutex_on block logdrop Dropped $* - [ -n "$nolock" ] || mutex_off + [ -n "$g_nolock" ] || mutex_off else fatal_error "$g_product is not started" fi @@ -2347,9 +2347,9 @@ logdrop_command() { reject_command() { if product_is_started ; then - [ -n "$nolock" ] || mutex_on + [ -n "$g_nolock" ] || mutex_on block $1 Rejected $* - [ -n "$nolock" ] || mutex_off + [ -n "$g_nolock" ] || mutex_off else fatal_error "$g_product is not started" fi @@ -2370,13 +2370,13 @@ save_command() { g_restorepath=${VARDIR}/$RESTOREFILE - [ -n "$nolock" ] || mutex_on + [ -n "$g_nolock" ] || mutex_on save_config result=$? - [ -n "$nolock" ] || mutex_off + [ -n "$g_nolock" ] || mutex_off exit $result } @@ -2641,7 +2641,7 @@ start_command() { do_it() { local rc rc=0 - [ -n "$nolock" ] || mutex_on + [ -n "$g_nolock" ] || mutex_on if [ -x ${VARDIR}/firewall ]; then run_it ${VARDIR}/firewall $debugging start @@ -2652,7 +2652,7 @@ start_command() { rc=2 fi - [ -n "$nolock" ] || mutex_off + [ -n "$g_nolock" ] || mutex_off exit $rc } @@ -2762,7 +2762,7 @@ restart_command() { ;; esac - [ -n "$nolock" ] || mutex_on + [ -n "$g_nolock" ] || mutex_on if [ -x ${VARDIR}/firewall ]; then run_it ${VARDIR}/firewall $debugging restart @@ -2773,7 +2773,7 @@ restart_command() { rc=2 fi - [ -n "$nolock" ] || mutex_off + [ -n "$g_nolock" ] || mutex_off return $rc } diff --git a/Shorewall/shorewall b/Shorewall/shorewall index a2e8f6972..5b5f6c7d6 100755 --- a/Shorewall/shorewall +++ b/Shorewall/shorewall @@ -25,7 +25,6 @@ # For a list of supported commands, type 'shorewall help' or 'shorewall6 help' # ################################################################################################ - g_debugging= if [ $# -gt 0 ] && [ "x$1" = "xdebug" -o "x$1" = "xtrace" ]; then @@ -33,17 +32,16 @@ if [ $# -gt 0 ] && [ "x$1" = "xdebug" -o "x$1" = "xtrace" ]; then shift fi -nolock= +g_nolock= if [ $# -gt 0 ] && [ "$1" = "nolock" ]; then - nolock=nolock + g_nolock=nolock shift fi SHOREWALL_DIR= g_noroutes= g_purge= - g_ipt_options="-nv" g_fast= g_verbose_offset=0 @@ -272,17 +270,17 @@ case "$COMMAND" in [ $# -ne 1 ] && usage 1 get_config [ -x $g_firewall ] || fatal_error "$g_product has never been started" - [ -n "$nolock" ] || mutex_on + [ -n "$g_nolock" ] || mutex_on run_it $g_firewall $g_debugging $COMMAND - [ -n "$nolock" ] || mutex_off + [ -n "$g_nolock" ] || mutex_off ;; reset) get_config shift - [ -n "$nolock" ] || mutex_on + [ -n "$g_nolock" ] || mutex_on [ -x $g_firewall ] || fatal_error "$g_product has never been started" run_it $g_firewall $g_debugging reset $@ - [ -n "$nolock" ] || mutex_off + [ -n "$g_nolock" ] || mutex_off ;; restart) get_config Yes Yes