From patchwork Fri May 13 17:10:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 5615 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 (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4L0FXY5lxSz3x1v for ; Fri, 13 May 2022 17:10:53 +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 (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4L0FXX5nfvz2NG; Fri, 13 May 2022 17:10:52 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4L0FXX58zhz2xyg; Fri, 13 May 2022 17:10: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 (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4L0FXW4dhwz2xQw for ; Fri, 13 May 2022 17:10:51 +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 (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4L0FXV5nLQzW4; Fri, 13 May 2022 17:10:50 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1652461851; 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; bh=/lFeATCcAvE0RTVhEjCEci86CkLVj68lgNU89DWHU3Q=; b=P6CSxjdR59NXK2XiOzaZ7BZm+bAepu8kuZ/0wI3OIjPRSIZa+xJ9Avp9TeO70+F6YeOvgi 14z0c8xPnRyEZlBw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1652461851; 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; bh=/lFeATCcAvE0RTVhEjCEci86CkLVj68lgNU89DWHU3Q=; b=YOO8uNpm0iJM8xxu1NPY4I2vkjQwdx83nZPFRj77mvrMUnLo5gKXvwHbepg/RikbSIAgAe I4gjU02hsN0zTM0Fsph5f02u3mLf5kf9dDtwh0OaiNH64Vggx1diEH1gWRiG9pIwHSsUZj xCx0jjCwabUJyCXaYfY1B0gMJ88qvPWbQg1wgEesRuEPw+KO0TdoBlaZHkft3su3em1aam pVzjmvJ2a0f8h69dVvzRiQG/ngDOasVkFfRSMU7I2ybeGYAwtZ8MUrZ+/+3sM42le8hfrp jJ5270qVPqiMzpUUhQ9bSeQmfeqMNK4/6Y0GlNLr8NHOJ5vusqRdSOiuqnu0Jg== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH] update-ids-ruleset: Silent script if no providers settings file exists. Date: Fri, 13 May 2022 19:10:44 +0200 Message-Id: <20220513171044.39793-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Only try to read-in the providers settings file, in case it exists. Otherwise the script produces an error message, about the missing file, each time it gets executed. Because of the fcron job this would be twice a day in most cases. Signed-off-by: Stefan Schantl Reviewed-by: Michael Tremer --- src/scripts/update-ids-ruleset | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scripts/update-ids-ruleset b/src/scripts/update-ids-ruleset index e9a082e62..553c1a1e1 100644 --- a/src/scripts/update-ids-ruleset +++ b/src/scripts/update-ids-ruleset @@ -95,8 +95,8 @@ if ($return) { # The script has requested a lock, so set locket to "1". $locked = "1"; -# Grab the configured providers. -&General::readhasharray("$IDS::providers_settings_file", \%providers); +# Grab the configured providers, if the providers settings file exists. +&General::readhasharray("$IDS::providers_settings_file", \%providers) if (-f "$IDS::providers_settings_file"); # Loop through the array of available providers. foreach my $id (keys %providers) {