]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
update.sh: Add SPAMHAUS_DROP if SPAMHAUS_EDROP was previously used
authorAdolf Belka <adolf.belka@ipfire.org>
Sat, 4 May 2024 13:05:20 +0000 (15:05 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Tue, 7 May 2024 05:51:05 +0000 (05:51 +0000)
- I realised that the previous patch for update.sh related to the ipblocklist removal
   of ALIENVAULT and SPAMHAUS_EDROP only removed the SPAMHAUS_EDROP setting. It makes sense
   to add SPAMHAUS_DROP to the settings file if SPAMHAUS_EDROP was previously used and
   SPAMHAUS_DROP was not selected.
- This patch adds the above change.

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/rootfiles/core/186/update.sh

index 444b041a4960e97d6128e86c518fbc08d7796f7f..5d7add89f95fd542123de6964567558718697731 100644 (file)
@@ -141,6 +141,7 @@ 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
+# If SPAMHAUS_EDROP was used and SPAMHAUS_DROP not used then add SPAMHAUS_DROP to settings file
 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
@@ -148,6 +149,9 @@ if [ -e /var/lib/ipblocklist/ALIENVAULT.conf ]; then
 fi
 if [ -e /var/lib/ipblocklist/SPAMHAUS_EDROP.conf ]; then
        rm /var/lib/ipblocklist/SPAMHAUS_EDROP.conf
+       if [ ! -e /var/lib/ipblocklist/SPAMHAUS_DROP.conf ]; then
+               echo "SPAMHAUS_DROP=on" >> /var/ipfire/ipblocklist/settings
+       fi
 fi
 
 # This update needs a reboot...