Correct 'start -f' with AUTOMAKE=Yes

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2011-11-03 06:59:01 -07:00
parent e236be37db
commit d883e45f83
2 changed files with 24 additions and 30 deletions

View File

@ -330,7 +330,7 @@ startup_error() {
# Determine if there are config files newer than the passed object # Determine if there are config files newer than the passed object
# #
uptodate() { uptodate() {
[ -f $1 ] || return 1 [ -x $1 ] || return 1
local dir local dir
local ifs local ifs
@ -425,11 +425,10 @@ start_command() {
local finished local finished
finished=0 finished=0
local object local object
do_it() {
local rc local rc
rc=0 rc=0
do_it() {
if [ -n "$AUTOMAKE" ]; then if [ -n "$AUTOMAKE" ]; then
[ -n "$nolock" ] || mutex_on [ -n "$nolock" ] || mutex_on
run_it ${VARDIR}/firewall $g_debugging start run_it ${VARDIR}/firewall $g_debugging start
@ -541,17 +540,15 @@ start_command() {
AUTOMAKE= AUTOMAKE=
fi fi
if [ -n "$g_fast" ]; then if [ -n "$g_fast" -a $object = $RESTOREFILE ]; then
g_restorepath=${VARDIR}/$RESTOREFILE g_restorepath=${VARDIR}/$object
[ -n "$nolock" ] || mutex_on
if [ -x $g_restorepath ]; then
echo Restoring Shorewall... echo Restoring Shorewall...
run_it $g_restorepath restore run_it $g_restorepath restore
date > ${VARDIR}/restarted rc=$?
progress_message3 Shorewall restored from $g_restorepath [ -n "$nolock" ] || mutex_off
else [ $rc -eq 0 ] && progress_message3 "Shorewall restored from $g_restorepath"
do_it exit $rc
fi
else else
do_it do_it
fi fi

View File

@ -330,7 +330,7 @@ startup_error() {
# Determine if there are config files newer than the passed object # Determine if there are config files newer than the passed object
# #
uptodate() { uptodate() {
[ -f $1 ] || return 1 [ -x $1 ] || return 1
local dir local dir
local ifs local ifs
@ -426,11 +426,10 @@ start_command() {
local finished local finished
finished=0 finished=0
local object local object
do_it() {
local rc local rc
rc=0 rc=0
do_it() {
if [ -n "$AUTOMAKE" ]; then if [ -n "$AUTOMAKE" ]; then
[ -n "$nolock" ] || mutex_on [ -n "$nolock" ] || mutex_on
run_it ${VARDIR}/firewall $g_debugging start run_it ${VARDIR}/firewall $g_debugging start
@ -542,17 +541,15 @@ start_command() {
AUTOMAKE= AUTOMAKE=
fi fi
if [ -n "$g_fast" ]; then if [ -n "$g_fast" -a $object = $RESTOREFILE ]; then
g_restorepath=${VARDIR}/$RESTOREFILE g_restorepath=${VARDIR}/$object
[ -n "$nolock" ] || mutex_on
if [ -x $g_restorepath ]; then echo Restoring Shorewall...
echo Restoring Shorewall6...
run_it $g_restorepath restore run_it $g_restorepath restore
date > ${VARDIR}/restarted rc=$?
progress_message3 Shorewall6 restored from $g_restorepath [ -n "$nolock" ] || mutex_off
else [ $rc -eq 0 ] && progress_message3 "Shorewall6 restored from $g_restorepath"
do_it exit $rc
fi
else else
do_it do_it
fi fi