From patchwork Fri Apr 19 13:39:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adolf Belka X-Patchwork-Id: 7746 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4VLbNs3jVYz3wyH for ; Fri, 19 Apr 2024 13:39:57 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4VLbNm4QWTz2y8; Fri, 19 Apr 2024 13:39:52 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4VLbNm0XPwz32sM; Fri, 19 Apr 2024 13:39:52 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4VLbNh4LVCz32rY for ; Fri, 19 Apr 2024 13:39:48 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4VLbNh1LjLz2Qx; Fri, 19 Apr 2024 13:39:48 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1713533988; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=f30GxmhER/GoVE6onW+Y7rCrIvc21Lv9LheH/zmQR+s=; b=0NjDeuckLX0hY9rhoD25BuuPo6WRbnS3C+iwTbWZwlcFXQmqCpIvy14do/GWl/UPrnR43H aUW+nZ/6XDIDajBA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1713533988; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=f30GxmhER/GoVE6onW+Y7rCrIvc21Lv9LheH/zmQR+s=; b=lh4KJsyT7NQYAVREAoZz15KDEbzsGIJ7cyqw/RFfWuwxTFtTQpngP/LKa4V0ZWJAaabKv6 rO5D/0A1tIGVoFxOrbbMP8gfvZKpjxchGLn7i9Ot1hzDKLZq7WDmueC2y4Fi30NbNi4qF3 SJaIbku0FXyN4NKDMG8izbgbXiswHEi+8UH/evqzaZ6KfjKLddhR16vbheEkC+QxhqZ5uq knRHCJz6zBRasEvwZKi17LQqRJhunH9WgbyKmHzZDINx7x/s5inkkeghjidVh38dmPuuTl k0TsevAY+hK6jhJC2n1oiL1hOUQA79l6BL1V21S6J07DkDZgvS3N1Lmbe3QZBw== 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> References: <20240419133941.3503396-1-adolf.belka@ipfire.org> MIME-Version: 1.0 Message-ID-Hash: G2MKNRSTXEERZ7KIG6HWWQF6SZA7KYJW X-Message-ID-Hash: G2MKNRSTXEERZ7KIG6HWWQF6SZA7KYJW X-MailFrom: adolf.belka@ipfire.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: IPFire development talk Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: - 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() { # Update OpenVPN CRL /etc/fcron.daily/openvpn-crl-updater - + # 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 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 return 0 }