[2/2] update.sh: Remove existing entries for the three FEODO_ tracker lists

Message ID 20241016165020.9287-2-adolf.belka@ipfire.org
State New
Headers
Series [1/2] sources: Removal of Feodo Tracker lists from ipblocklist sources file |

Commit Message

Adolf Belka Oct. 16, 2024, 4:50 p.m. UTC
  - This removes any time entries in the modified file for either FEODO_RECOMMENDED,
   FEODO_IP or FEODO_AGGRESSIVE.
- This also removes any blocklists for any of these sources from the /var/lib/ipblocklist
   directory.
- This patch will ensure that any reference to any of these sources is removed from the
   ipblocklist files.

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

Patch

diff --git a/config/rootfiles/core/190/update.sh b/config/rootfiles/core/190/update.sh
index 16ef608e2..cec9492eb 100644
--- a/config/rootfiles/core/190/update.sh
+++ b/config/rootfiles/core/190/update.sh
@@ -145,6 +145,21 @@  if [ -e /boot/pakfire-kernel-update ]; then
     /boot/pakfire-kernel-update ${KVER}
 fi
 
+# Remove any entry for FEODO_RECOMMENDED, FEODO_IP or FEODO_AGGRESSIVE from the ipblocklist
+# modified file and the associated ipblocklist files from the /var/lib/ipblocklist directory
+sed -i '/FEODO_RECOMMENDED=/d' /var/ipfire/ipblocklist/modified
+sed -i '/FEODO_IP=/d' /var/ipfire/ipblocklist/modified
+sed -i '/FEODO_AGGRESSIVE=/d' /var/ipfire/ipblocklist/modified
+if [ -e /var/lib/ipblocklist/FEODO_RECOMMENDED.conf ]; then
+	rm /var/lib/ipblocklist/FEODO_RECOMMENDED.conf
+fi
+if [ -e /var/lib/ipblocklist/FEODO_IP.conf ]; then
+	rm /var/lib/ipblocklist/FEODO_IP.conf
+fi
+if [ -e /var/lib/ipblocklist/FEODO_AGGRESSIVE.conf ]; then
+	rm /var/lib/ipblocklist/FEODO_AGGRESSIVE.conf
+fi
+
 # This update needs a reboot...
 touch /var/run/need_reboot