[3/4] update.sh: Core195 - remove any 3coresec ipblocklists during Core Update

Message ID 20250424142041.3443255-3-adolf.belka@ipfire.org
State New
Headers
Series [1/4] sources: remove the 3CORESEC ipblocklist entries from the sources file |

Commit Message

Adolf Belka 24 Apr 2025, 2:20 p.m. UTC
- This ensures that any existing 3coresec blocklists that might have been selected
   when they existed will be removed from users systems.

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

Patch

diff --git a/config/rootfiles/core/195/update.sh b/config/rootfiles/core/195/update.sh
index ee9b53497..e934693cd 100644
--- a/config/rootfiles/core/195/update.sh
+++ b/config/rootfiles/core/195/update.sh
@@ -47,6 +47,21 @@  ldconfig
 # Filesytem cleanup
 /usr/local/bin/filesystem-cleanup
 
+# Remove any entry for 3CORESEC_SSH, 3CORESEC_SCAN or 3CORESEC_WEB from the ipblocklist modified file
+# and the associated ipblocklist files from the /var/lib/ipblocklist directory
+sed -i '/3CORESEC_SSH=/d' /var/ipfire/ipblocklist/modified
+if [ -e /var/lib/ipblocklist/3CORESEC_SSH.conf ]; then
+	rm /var/lib/ipblocklist/3CORESEC_SSH.conf
+fi
+sed -i '/3CORESEC_SCAN=/d' /var/ipfire/ipblocklist/modified
+if [ -e /var/lib/ipblocklist/3CORESEC_SCAN.conf ]; then
+	rm /var/lib/ipblocklist/3CORESEC_SCAN.conf
+fi
+sed -i '/3CORESEC_WEB=/d' /var/ipfire/ipblocklist/modified
+if [ -e /var/lib/ipblocklist/3CORESEC_WEB.conf ]; then
+	rm /var/lib/ipblocklist/3CORESEC_WEB.conf
+fi
+
 # Start services
 
 # This update needs a reboot...