]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
update-ids-ruleset: Skip unsupported providers.
authorStefan Schantl <stefan.schantl@ipfire.org>
Sun, 17 Apr 2022 13:02:41 +0000 (15:02 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Sun, 17 Apr 2022 13:02:41 +0000 (15:02 +0200)
In case a configured provider is not longer supported, simply skip it
and do not try to perform an update.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
src/scripts/update-ids-ruleset

index c62bdcb3b18219105cbec571eb673abc851e047c..e9a082e629231d268b5915d88abfe943814b3785 100644 (file)
@@ -26,6 +26,9 @@ require '/var/ipfire/general-functions.pl';
 require "${General::swroot}/ids-functions.pl";
 require "${General::swroot}/lang.pl";
 
+# Import ruleset providers file.
+require "$IDS::rulesetsourcesfile";
+
 # Load perl module to talk to the kernel syslog.
 use Sys::Syslog qw(:DEFAULT setlogsock);
 
@@ -102,6 +105,9 @@ foreach my $id (keys %providers) {
        my $enabled_status = $providers{$id}[2];
        my $autoupdate_status = $providers{$id}[3];
 
+       # Skip unsupported providers.
+       next unless($IDS::Ruleset::Providers{$provider});
+
        # Skip the provider if it is not enabled.
        next unless($enabled_status eq "enabled");