[2/3] backup.pl: Remove ABUSECH_BOTNETC2 lists from backup during restore.

Message ID 20250220211325.3273650-2-adolf.belka@ipfire.org
State New
Headers
Series [1/3] sources: Remove ABUSECH_BOTNETC2 from ipblocklist sources |

Commit Message

Adolf Belka Feb. 20, 2025, 9:13 p.m. UTC
  - This removes ABUSECH_BOTNETC2 from any backup during a restore in the same way as done
   previously with ALIENVAULT and SPAMHAUS_EDROP.

Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
---
 config/backup/backup.pl | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
  

Patch

diff --git a/config/backup/backup.pl b/config/backup/backup.pl
index 4f4273d26..1c8c87d0a 100644
--- a/config/backup/backup.pl
+++ b/config/backup/backup.pl
@@ -252,16 +252,20 @@  restore_backup() {
 			-out /etc/httpd/server.crt &>/dev/null
 	fi
 
-	# Remove any entry for ALIENVAULT or SPAMHAUS_EDROP from the ipblocklist modified file
+	# Remove any entry for ALIENVAULT, SPAMHAUS_EDROP or ABUSECH_BOTNETC2 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
+	sed -i '/ABUSECH_BOTNETC2=/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
+	if [ -e /var/lib/ipblocklist/ABUSECH_BOTNETC2.conf ]; then
+		rm /var/lib/ipblocklist/ABUSECH_BOTNETC2.conf
+	fi
 
 	# The collectd directory structure was changed but not all changes
 	# are done by the official migration script generator