Rename $nolock to $g_nolock

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2011-12-19 06:29:05 -08:00
parent 6b90c09c04
commit 075d7ca68b
2 changed files with 24 additions and 26 deletions

View File

@ -1251,17 +1251,17 @@ restore_command() {
g_restorepath=${VARDIR}/$RESTOREFILE g_restorepath=${VARDIR}/$RESTOREFILE
[ -n "$nolock" ] || mutex_on [ -n "$g_nolock" ] || mutex_on
if [ -x $g_restorepath ]; then if [ -x $g_restorepath ]; then
progress_message3 "Restoring $g_product..." progress_message3 "Restoring $g_product..."
run_it $g_restorepath restore && progress_message3 "$g_product restored from ${VARDIR}/$RESTOREFILE" run_it $g_restorepath restore && progress_message3 "$g_product restored from ${VARDIR}/$RESTOREFILE"
[ -n "$nolock" ] || mutex_off [ -n "$g_nolock" ] || mutex_off
else else
echo "File $g_restorepath: file not found" echo "File $g_restorepath: file not found"
[ -n "$nolock" ] || mutex_off [ -n "$g_nolock" ] || mutex_off
exit 2 exit 2
fi fi
} }
@ -1357,7 +1357,7 @@ block() # $1 = command, $2 = Finished, $3 - $n addresses
if ! chain_exists dynamic; then if ! chain_exists dynamic; then
echo "Dynamic blacklisting is not enabled in the current $g_product configuration" >&2 echo "Dynamic blacklisting is not enabled in the current $g_product configuration" >&2
[ -n "$nolock" ] || mutex_off [ -n "$g_nolock" ] || mutex_off
exit 2 exit 2
fi fi
@ -1706,7 +1706,7 @@ allow_command() {
exit 2 exit 2
fi fi
[ -n "$nolock" ] || mutex_on [ -n "$g_nolock" ] || mutex_on
while [ $# -gt 1 ]; do while [ $# -gt 1 ]; do
shift shift
case $1 in case $1 in
@ -1744,7 +1744,7 @@ allow_command() {
;; ;;
esac esac
done done
[ -n "$nolock" ] || mutex_off [ -n "$g_nolock" ] || mutex_off
else else
error_message "ERROR: $g_product is not started" error_message "ERROR: $g_product is not started"
exit 2 exit 2
@ -2322,9 +2322,9 @@ drop_command() {
exit 2 exit 2
fi fi
[ -n "$nolock" ] || mutex_on [ -n "$g_nolock" ] || mutex_on
block DROP Dropped $* block DROP Dropped $*
[ -n "$nolock" ] || mutex_off [ -n "$g_nolock" ] || mutex_off
else else
fatal_error "$g_product is not started" fatal_error "$g_product is not started"
fi fi
@ -2337,9 +2337,9 @@ logdrop_command() {
exit 2 exit 2
fi fi
[ -n "$nolock" ] || mutex_on [ -n "$g_nolock" ] || mutex_on
block logdrop Dropped $* block logdrop Dropped $*
[ -n "$nolock" ] || mutex_off [ -n "$g_nolock" ] || mutex_off
else else
fatal_error "$g_product is not started" fatal_error "$g_product is not started"
fi fi
@ -2347,9 +2347,9 @@ logdrop_command() {
reject_command() { reject_command() {
if product_is_started ; then if product_is_started ; then
[ -n "$nolock" ] || mutex_on [ -n "$g_nolock" ] || mutex_on
block $1 Rejected $* block $1 Rejected $*
[ -n "$nolock" ] || mutex_off [ -n "$g_nolock" ] || mutex_off
else else
fatal_error "$g_product is not started" fatal_error "$g_product is not started"
fi fi
@ -2370,13 +2370,13 @@ save_command() {
g_restorepath=${VARDIR}/$RESTOREFILE g_restorepath=${VARDIR}/$RESTOREFILE
[ -n "$nolock" ] || mutex_on [ -n "$g_nolock" ] || mutex_on
save_config save_config
result=$? result=$?
[ -n "$nolock" ] || mutex_off [ -n "$g_nolock" ] || mutex_off
exit $result exit $result
} }
@ -2641,7 +2641,7 @@ start_command() {
do_it() { do_it() {
local rc local rc
rc=0 rc=0
[ -n "$nolock" ] || mutex_on [ -n "$g_nolock" ] || mutex_on
if [ -x ${VARDIR}/firewall ]; then if [ -x ${VARDIR}/firewall ]; then
run_it ${VARDIR}/firewall $debugging start run_it ${VARDIR}/firewall $debugging start
@ -2652,7 +2652,7 @@ start_command() {
rc=2 rc=2
fi fi
[ -n "$nolock" ] || mutex_off [ -n "$g_nolock" ] || mutex_off
exit $rc exit $rc
} }
@ -2762,7 +2762,7 @@ restart_command() {
;; ;;
esac esac
[ -n "$nolock" ] || mutex_on [ -n "$g_nolock" ] || mutex_on
if [ -x ${VARDIR}/firewall ]; then if [ -x ${VARDIR}/firewall ]; then
run_it ${VARDIR}/firewall $debugging restart run_it ${VARDIR}/firewall $debugging restart
@ -2773,7 +2773,7 @@ restart_command() {
rc=2 rc=2
fi fi
[ -n "$nolock" ] || mutex_off [ -n "$g_nolock" ] || mutex_off
return $rc return $rc
} }

View File

@ -25,7 +25,6 @@
# For a list of supported commands, type 'shorewall help' or 'shorewall6 help' # For a list of supported commands, type 'shorewall help' or 'shorewall6 help'
# #
################################################################################################ ################################################################################################
g_debugging= g_debugging=
if [ $# -gt 0 ] && [ "x$1" = "xdebug" -o "x$1" = "xtrace" ]; then 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 shift
fi fi
nolock= g_nolock=
if [ $# -gt 0 ] && [ "$1" = "nolock" ]; then if [ $# -gt 0 ] && [ "$1" = "nolock" ]; then
nolock=nolock g_nolock=nolock
shift shift
fi fi
SHOREWALL_DIR= SHOREWALL_DIR=
g_noroutes= g_noroutes=
g_purge= g_purge=
g_ipt_options="-nv" g_ipt_options="-nv"
g_fast= g_fast=
g_verbose_offset=0 g_verbose_offset=0
@ -272,17 +270,17 @@ case "$COMMAND" in
[ $# -ne 1 ] && usage 1 [ $# -ne 1 ] && usage 1
get_config get_config
[ -x $g_firewall ] || fatal_error "$g_product has never been started" [ -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 run_it $g_firewall $g_debugging $COMMAND
[ -n "$nolock" ] || mutex_off [ -n "$g_nolock" ] || mutex_off
;; ;;
reset) reset)
get_config get_config
shift shift
[ -n "$nolock" ] || mutex_on [ -n "$g_nolock" ] || mutex_on
[ -x $g_firewall ] || fatal_error "$g_product has never been started" [ -x $g_firewall ] || fatal_error "$g_product has never been started"
run_it $g_firewall $g_debugging reset $@ run_it $g_firewall $g_debugging reset $@
[ -n "$nolock" ] || mutex_off [ -n "$g_nolock" ] || mutex_off
;; ;;
restart) restart)
get_config Yes Yes get_config Yes Yes