mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-20 16:02:59 +02:00
ids-functions.pl: Introduce drop_dl_rulesfile().
This tiny function is used, to delete the stored rulesfile in case a provider will be deleted. Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
This commit is contained in:
@@ -837,6 +837,22 @@ sub _get_dl_rulesfile($) {
|
||||
return $rulesfile;
|
||||
}
|
||||
|
||||
#
|
||||
## Tiny function to delete the stored ruleset file or tarball for a given provider.
|
||||
#
|
||||
sub drop_dl_rulesfile ($) {
|
||||
my ($provider) = @_;
|
||||
|
||||
# Gather the full path and name of the stored rulesfile.
|
||||
my $rulesfile = &_get_dl_rulesfile($provider);
|
||||
|
||||
# Check if the given rulesfile exists.
|
||||
if (-f $rulesfile) {
|
||||
# Delete the stored rulesfile.
|
||||
unlink($rulesfile) or die "Could not delete $rulesfile. $!\n";
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
## Function to check if the IDS is running.
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user