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:
Stefan Schantl
2021-03-31 13:39:43 +02:00
parent e31458de4e
commit 50f348f681

View File

@@ -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.
#