]> git.ipfire.org Git - people/stevee/ipfire-2.x.git/commitdiff
ids-functions.pl: Rework oinkmaster() to use get_enabled_providers
authorStefan Schantl <stefan.schantl@ipfire.org>
Wed, 31 Mar 2021 10:21:41 +0000 (12:21 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Sun, 19 Dec 2021 12:23:00 +0000 (13:23 +0100)
function.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
config/cfgroot/ids-functions.pl

index 9424ce567fde14c167d546ac9203792e3b8dae5f..98df831d9a529510ffed88bf7e684b2cde8b8e3c 100644 (file)
@@ -549,32 +549,17 @@ sub oinkmaster () {
        # Load perl module for file copying.
        use File::Copy;
 
-       # Hash to store the used providers.
-       my %used_providers = ();
-
-       # Array to store the enabled providers.
-       my @enabled_providers = ();
-
        # Check if the files in rulesdir have the correct permissions.
        &_check_rulesdir_permissions();
 
        # Cleanup the rules directory before filling it with the new rulests.
        &_cleanup_rulesdir();
 
-       # Read-in the providers config file.
-       &General::readhasharray("$providers_settings_file", \%used_providers);
-
-       # Loop through the hash of used_providers.
-       foreach my $id (keys %used_providers) {
-               # Skip disabled providers.
-               next unless ($used_providers{$id}[3] eq "enabled");
-
-               # Grab the provider handle.
-               my $provider = "$used_providers{$id}[0]";
-
-               # Add the provider handle to the array of enabled providers.
-               push(@enabled_providers, $provider);
+       # Get all enabled providers.
+       my @enabled_provides = &get_enabled_providers();
 
+       # Loop through the array of enabled providers.
+       foreach my $provider (@enabled_providers) {
                # Omit the type (dl_type) of the stored ruleset.
                my $type = $IDS::Ruleset::Providers{$provider}{'dl_type'};