]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
backup.pl: removes any references to ALIENVAULT & SPAMHAUSEDROP from restores
authorAdolf Belka <adolf.belka@ipfire.org>
Fri, 19 Apr 2024 13:39:41 +0000 (15:39 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Fri, 19 Apr 2024 19:51:24 +0000 (19:51 +0000)
- This patch ensures that if a restore is carried out from an earlier version that includes
   ALIENVAULT and/or SPAMHAUS_EDROP that the references will be removed.
- This is the same code as was put into the update.sh file with the previous patch of this
   set.

Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
config/backup/backup.pl

index b43420740037075b0b76173477333f86f0f8d90d..d848084e944e68225a7d52f51ddc5635b862cde5 100644 (file)
@@ -193,7 +193,7 @@ restore_backup() {
 
        # Update OpenVPN CRL
        /etc/fcron.daily/openvpn-crl-updater
-       
+
        # Update OpenVPN N2N Client Configs
        ## Add providers legacy default line to n2n client config files
        # Check if ovpnconfig exists and is not empty
@@ -246,6 +246,17 @@ restore_backup() {
                        -signkey /etc/httpd/server.key \
                        -out /etc/httpd/server.crt &>/dev/null
        fi
+
+       # Remove any entry for ALIENVAULT or SPAMHAUS_EDROP from the ipblocklist modified file
+       # and the associated ipblocklist files from the /var/lib/ipblocklist directory
+       sed -i '/ALIENVAULT=/d' /var/ipfire/ipblocklist/modified
+       sed -i '/SPAMHAUS_EDROP=/d' /var/ipfire/ipblocklist/modified
+       if [ -e /var/lib/ipblocklist/ALIENVAULT.conf ]; then
+               rm /var/lib/ipblocklist/ALIENVAULT.conf
+       fi
+       if [ -e /var/lib/ipblocklist/SPAMHAUS_EDROP.conf ]; then
+               rm /var/lib/ipblocklist/SPAMHAUS_EDROP.conf
+       fi
        return 0
 }