diff --git a/Shorewall/Perl/Shorewall/Compiler.pm b/Shorewall/Perl/Shorewall/Compiler.pm index a15ffccbf..b24b5c6e0 100644 --- a/Shorewall/Perl/Shorewall/Compiler.pm +++ b/Shorewall/Perl/Shorewall/Compiler.pm @@ -361,11 +361,11 @@ sub generate_script_3($) { '', 'case $IPSET in', ' */*)', - ' [ -x "$IPSET" ] || fatal_error "IPSET=$IPSET does not exist or is not executable"', + ' [ -x "$IPSET" ] || startup_error "IPSET=$IPSET does not exist or is not executable"', ' ;;', ' *)', ' IPSET="$(mywhich $IPSET)"', - ' [ -n "$IPSET" ] || fatal_error "The ipset utility cannot be located"' , + ' [ -n "$IPSET" ] || startup_error "The ipset utility cannot be located"' , ' ;;', 'esac', '', @@ -375,11 +375,15 @@ sub generate_script_3($) { ' $IPSET -X' , ' $IPSET -R < ${VARDIR}/ipsets.save' , ' fi' , - 'elif [ "$COMMAND" = restart ]; then' , - ' if [ -f $(my_pathname)-ipsets ] && ! chain_exists shorewall; then' , - ' $IPSET -F' , - ' $IPSET -X' , - ' $IPSET -R < $(my_pathname)-ipsets' , + 'elif [ "$COMMAND" = restore ]; then' , + ' if [ -f $(my_pathname)-ipsets ]; then' , + ' if chain_exists shorewall; then' , + ' startup_error "Cannot restore $(my_pathname)-ipsets with Shorewall running"' , + ' else' , + ' $IPSET -F' , + ' $IPSET -X' , + ' $IPSET -R < $(my_pathname)-ipsets' , + ' fi' , ' fi' , );