]> git.ipfire.org Git - people/stevee/ipfire-2.x.git/commitdiff
ipblocklist-functions.pl: Switch to get_cached_blocklist_file()
authorStefan Schantl <stefan.schantl@ipfire.org>
Fri, 14 Apr 2023 15:25:46 +0000 (17:25 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Fri, 14 Apr 2023 15:25:46 +0000 (17:25 +0200)
Replace the get_ipset_db_file() function to get_cache_blocklist_file().

This function will return the filename of the cached blocklist file
in "/var/cache/ipblocklist/".

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
config/cfgroot/ipblocklist-functions.pl

index b293f7098ec4d9d35698c1dd8ea1d152f51c287a..1163d087b717ef85426817fafcfd56aa7870d913 100644 (file)
@@ -32,12 +32,12 @@ our $settings_dir = "/var/ipfire/ipblocklist";
 # Main settings file.
 our $settings_file = "$settings_dir/settings";
 
+# Location where the raw blocklists are stored.
+our $blocklist_cache_dir = "/var/cache/ipblocklist";
+
 # Location where the blocklists in ipset compatible format are stored.
 our $blocklist_dir = "/var/lib/ipblocklist";
 
-# File extension of the blocklist files.
-my $blocklist_file_extension = ".conf";
-
 # File to store Etags.
 our $etags_file = "$settings_dir/etags";
 
@@ -70,13 +70,13 @@ sub get_blocklists () {
 }
 
 #
-## Tiny function to get the full path and name of a given blocklist.
+## Function to get the full path and name of the cached blocklist.
 #
-sub get_ipset_db_file($) {
-       my ($set) = @_;
+sub get_cached_blocklist_file ($) {
+       my ($list) = @_;
 
-       # Generate the
-       my $file = "$blocklist_dir/$set$blocklist_file_extension";
+       # Generate the file name and full path, based on the given list.
+       my $file = "$blocklist_cache_dir/$list$cached_blocklist_file_extension";
 
        # Return the file name.
        return $file;