mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
ids-functions.pl: Add remove_from_etags() function.
This function is used to drop the stored etags data of a given provider. Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
This commit is contained in:
@@ -1884,6 +1884,30 @@ sub get_provider_used_rulesfiles($) {
|
||||
return @used_rulesfiles;
|
||||
}
|
||||
|
||||
#
|
||||
## Function to delete the stored etag data of a given provider.
|
||||
#
|
||||
sub remove_from_etags ($) {
|
||||
my ($provider) = @_;
|
||||
|
||||
my %etags;
|
||||
|
||||
# Early exit function if the etags file does not exist.
|
||||
return unless (-f $etags_file);
|
||||
|
||||
# Read-in etag file.
|
||||
&General::readhash("$etags_file", \%etags);
|
||||
|
||||
# Check if the hash contains an entry for the given provider.
|
||||
if ($etags{$provider}) {
|
||||
# Drop the entry.
|
||||
delete($etags{$provider});
|
||||
|
||||
# Write back the etags file.
|
||||
&General::writehash("$etags_file", \%etags);
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
## Function to write the lock file for locking the WUI, while
|
||||
## the autoupdate script runs.
|
||||
|
||||
Reference in New Issue
Block a user