ids-functions.pl: Add get_ruleset_providers() function.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
This commit is contained in:
Stefan Schantl
2021-03-19 21:27:23 +01:00
parent 179b75107e
commit 70cc13158d

View File

@@ -112,6 +112,24 @@ sub check_and_create_filelayout() {
unless (-f "$whitelist_file" ) { &create_empty_file($whitelist_file); }
}
#
## Function to get a list of all available ruleset providers.
##
## They will be returned as a sorted array.
#
sub get_ruleset_providers() {
my @providers;
# Loop through the hash of providers.
foreach my $provider ( keys %IDS::Ruleset::Providers ) {
# Add the provider to the array.
push(@providers, $provider);
}
# Sort and return the array.
return sort(@providers);
}
#
## Function for checking if at least 300MB of free disk space are available
## on the "/var" partition.