From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: development@lists.ipfire.org Subject: Re: [PATCH] update-ids-ruleset: Silent script if no providers settings file exists. Date: Fri, 13 May 2022 21:12:59 +0100 Message-ID: <31E66EFD-64E3-4320-9CDA-6A9E3055C9EE@ipfire.org> In-Reply-To: <20220513171044.39793-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7840840115551937688==" List-Id: --===============7840840115551937688== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Reviewed-by: Michael Tremer > On 13 May 2022, at 18:10, Stefan Schantl wrot= e: >=20 > 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. >=20 > Because of the fcron job this would be twice a day in most cases. >=20 > Signed-off-by: Stefan Schantl > --- > src/scripts/update-ids-ruleset | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > 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 =3D "1"; >=20 > -# 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"); >=20 > # Loop through the array of available providers. > foreach my $id (keys %providers) { > --=20 > 2.30.2 >=20 --===============7840840115551937688==--