mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-12 04:05:53 +02:00
ids-functions.pl: Introduce move_tmp_ruleset() function.
This function is used to move an extracted temporary ruleset to the rules location. Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
This commit is contained in:
@@ -751,6 +751,27 @@ sub merge_sid_msg (@) {
|
||||
close(FILE);
|
||||
}
|
||||
|
||||
#
|
||||
## A very tiny function to move an extracted ruleset from the temporary directory into
|
||||
## the rules directory.
|
||||
#
|
||||
sub move_tmp_ruleset() {
|
||||
# Load perl module.
|
||||
use File::Copy;
|
||||
|
||||
# Do a directory listing of the temporary directory.
|
||||
opendir DH, $tmp_rules_directory;
|
||||
|
||||
# Loop over all files.
|
||||
while(my $file = readdir DH) {
|
||||
# Move them to the rules directory.
|
||||
move "$tmp_rules_directory/$file" , "$rulespath/$file";
|
||||
}
|
||||
|
||||
# Close directory handle.
|
||||
closedir DH;
|
||||
}
|
||||
|
||||
#
|
||||
## Function to cleanup the temporary IDS directroy.
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user