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
#
emit( '' ,
" for set in \$(\$IPSET save | grep '$select' | cut -d' ' -f2); do" ,
' $IPSET flush $set' ,
' $IPSET destroy $set' ,
" done" ,
' if [ -f ${VARDIR}/ipsets.save ]; then' ,
' while read ${VARDIR}/ipsets.save verb set; do' ,
' if [ $verb = create ]; then' ,
' $IPSET flush $set' ,
' $IPSET destroy $set' ,
' fi' ,
' done' ,
' fi',
);
} else {
#