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
[ -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
}

View File

@ -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