return sort(@blocklists);
}
+#
+## Function to get all enabled blocklists.
+#
+sub get_enabled_blocklists () {
+ my @enabled_blocklists;
+ my %settings;
+
+ # Get all available blocklists.
+ my @blocklists = &get_blocklists();
+
+ # Read-in blocklist settings.
+ &General::readhash($settings_file, \%settings) if (-e $settings_file);
+
+ # Loop through the array of available blocklists.
+ foreach my $blocklist (@blocklists) {
+ # Check if the blocklist is enabled.
+ if ((exists($settings{$blocklist})) && ($settings{$blocklist} eq "on")) {
+ # Add the blocklist to the array of enabled blocklists.
+ push(@enabled_blocklists, $blocklist);
+ }
+ }
+
+ # Return the array of enabled blocklists.
+ return @enabled_blocklists;
+}
+
#
## Function to get the full path and name of the cached blocklist.
#