From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adolf Belka To: development@lists.ipfire.org Subject: [PATCH 3/3] backup.pl: removes any references to ALIENVAULT & SPAMHAUSEDROP from restores Date: Fri, 19 Apr 2024 15:39:41 +0200 Message-ID: <20240419133941.3503396-3-adolf.belka@ipfire.org> In-Reply-To: <20240419133941.3503396-1-adolf.belka@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0025581301834308448==" List-Id: --===============0025581301834308448== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable - This patch ensures that if a restore is carried out from an earlier version= that includes ALIENVAULT and/or SPAMHAUS_EDROP that the references will be removed. - This is the same code as was put into the update.sh file with the previous = patch of this set. Tested-by: Adolf Belka Signed-off-by: Adolf Belka --- config/backup/backup.pl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/config/backup/backup.pl b/config/backup/backup.pl index b43420740..d848084e9 100644 --- a/config/backup/backup.pl +++ b/config/backup/backup.pl @@ -193,7 +193,7 @@ restore_backup() { =20 # Update OpenVPN CRL /etc/fcron.daily/openvpn-crl-updater -=09 + # Update OpenVPN N2N Client Configs ## Add providers legacy default line to n2n client config files # Check if ovpnconfig exists and is not empty @@ -246,6 +246,17 @@ restore_backup() { -signkey /etc/httpd/server.key \ -out /etc/httpd/server.crt &>/dev/null fi + + # Remove any entry for ALIENVAULT or SPAMHAUS_EDROP from the ipblocklist mo= dified file + # and the associated ipblocklist files from the /var/lib/ipblocklist direct= ory + sed -i '/ALIENVAULT=3D/d' /var/ipfire/ipblocklist/modified + sed -i '/SPAMHAUS_EDROP=3D/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 return 0 } =20 --=20 2.44.0 --===============0025581301834308448==--