[2/3] update.sh: Remove existing entries for ALIENVAULT & SPAMHAUS_EDROP

Message ID 20240419133941.3503396-2-adolf.belka@ipfire.org
State Staged
Commit 6408ff8d6a952cd88927a7ba6a7aece6cdfb04c0
Headers
Series [1/3] sources: Removal of ALIENVAULT and SPAMHAUS_EDROP from ipblocklist sources |

Commit Message

Adolf Belka April 19, 2024, 1:39 p.m. UTC
  - This removes any time entries in the modified file for either ALIENVAULT or
   SPAMHAUS_EDROP.
- This also removes any blocklists for either of these sources from the /var/lib/ipblocklist
   directory.
- This patch will ensure that any reference to either of these sources is removed from the
   ipblocklist files.

Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
---
 config/rootfiles/core/186/update.sh | 11 +++++++++++
 1 file changed, 11 insertions(+)
  

Patch

diff --git a/config/rootfiles/core/186/update.sh b/config/rootfiles/core/186/update.sh
index d79a35133..9a4bd7f2a 100644
--- a/config/rootfiles/core/186/update.sh
+++ b/config/rootfiles/core/186/update.sh
@@ -123,6 +123,17 @@  if [ -e /boot/pakfire-kernel-update ]; then
     /boot/pakfire-kernel-update ${KVER}
 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
+
 # This update needs a reboot...
 touch /var/run/need_reboot