Only destroy ipsets that will be restored

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2020-04-20 09:11:03 -07:00
parent 057a2dec70
commit 086f7a0e6d
No known key found for this signature in database
GPG Key ID: 96E6B3F2423A4D10

View File

@ -9065,10 +9065,14 @@ sub create_load_ipsets() {
# Requires V5 or later # Requires V5 or later
# #
emit( '' , emit( '' ,
" for set in \$(\$IPSET save | grep '$select' | cut -d' ' -f2); do" , ' if [ -f ${VARDIR}/ipsets.save ]; then' ,
' $IPSET flush $set' , ' while read ${VARDIR}/ipsets.save verb set; do' ,
' $IPSET destroy $set' , ' if [ $verb = create ]; then' ,
" done" , ' $IPSET flush $set' ,
' $IPSET destroy $set' ,
' fi' ,
' done' ,
' fi',
); );
} else { } else {
# #