Don't try to restore ipsets when 'restore' is being used to recover

from a start/restart failure.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2010-01-06 07:44:00 -08:00
parent d362af9fb6
commit 605da92eca
4 changed files with 8 additions and 2 deletions

View File

@ -375,7 +375,7 @@ sub generate_script_3($) {
' $IPSET -X' , ' $IPSET -X' ,
' $IPSET -R < ${VARDIR}/ipsets.save' , ' $IPSET -R < ${VARDIR}/ipsets.save' ,
' fi' , ' fi' ,
'elif [ "$COMMAND" = restore ]; then' , 'elif [ "$COMMAND" = restore -a -z "$RECOVERING" ]; then' ,
' if [ -f $(my_pathname)-ipsets ]; then' , ' if [ -f $(my_pathname)-ipsets ]; then' ,
' if chain_exists shorewall; then' , ' if chain_exists shorewall; then' ,
' startup_error "Cannot restore $(my_pathname)-ipsets with Shorewall running"' , ' startup_error "Cannot restore $(my_pathname)-ipsets with Shorewall running"' ,

View File

@ -2208,6 +2208,9 @@ EOF
if [ -x $RESTOREPATH ]; then if [ -x $RESTOREPATH ]; then
echo Restoring ${PRODUCT:=Shorewall}... echo Restoring ${PRODUCT:=Shorewall}...
RECOVERING=Yes
export RECOVERING
if $RESTOREPATH restore; then if $RESTOREPATH restore; then
echo "$PRODUCT restored from $RESTOREPATH" echo "$PRODUCT restored from $RESTOREPATH"

View File

@ -1593,6 +1593,8 @@ FIREWALL=${VARDIR}/firewall
LIBRARIES="$SHAREDIR/lib.base $SHAREDIR/lib.cli" LIBRARIES="$SHAREDIR/lib.base $SHAREDIR/lib.cli"
VERSION_FILE=$SHAREDIR/version VERSION_FILE=$SHAREDIR/version
REFRESHCHAINS= REFRESHCHAINS=
RECOVERING=
export RECOVERING
for library in $LIBRARIES; do for library in $LIBRARIES; do
if [ -f $library ]; then if [ -f $library ]; then

View File

@ -1494,7 +1494,8 @@ fi
FIREWALL=${VARDIR}/firewall FIREWALL=${VARDIR}/firewall
LIBRARIES="$SHAREDIR/lib.base $SHAREDIR/lib.cli" LIBRARIES="$SHAREDIR/lib.base $SHAREDIR/lib.cli"
VERSION_FILE=$SHAREDIR/version VERSION_FILE=$SHAREDIR/version
REFRESHCHAINS= RRECOVERING=
export RECOVERING
for library in $LIBRARIES; do for library in $LIBRARIES; do
if [ -f $library ]; then if [ -f $library ]; then