From e763ec8c425f73eb96adc5265ae1258b697a3ea6 Mon Sep 17 00:00:00 2001 From: Janik Kleinhoff Date: Sun, 12 Feb 2017 13:52:23 +0000 Subject: Make wordlist.txt, proxy.txt, nick_blacklist.txt optional wordlist is used exclusively by garbagemeter which has been disabled for quite a while. We'd probably be better off using a config-defined path anyway so people can point the bot at /usr/share/dict/words or the local equivalent. The proxy list is most likely completely out of date. We have DNSBLs for this anyway. The nick blacklist is inflexible; nick blacklisting with an added reason can already be done via the rules file. Note that the functionality is not removed for now to avoid breaking compatibility. --- meta.pl | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'meta.pl') diff --git a/meta.pl b/meta.pl index abdd76d..1e0af85 100755 --- a/meta.pl +++ b/meta.pl @@ -188,21 +188,27 @@ sub init { ASM::Statsp->new($conn); $::classes = ASM::Classes->new(); ASM::Fifo->new($irc, $conn); - my @nickbl = io('nick_blacklist.txt')->getlines; - chomp @nickbl; - @::nick_blacklist = @nickbl; + if (-e 'nick_blacklist.txt') { + my @nickbl = io('nick_blacklist.txt')->getlines; + chomp @nickbl; + @::nick_blacklist = @nickbl; + } %::proxies = (); - my @proxy = io('proxy.txt')->getlines; - chomp @proxy; - foreach my $line (@proxy) { - if ($line =~ /(\d+\.\d+\.\d+\.\d+):\d+/) { - $::proxies{$1} = 1; + if (-e 'proxy.txt') { + my @proxy = io('proxy.txt')->getlines; + chomp @proxy; + foreach my $line (@proxy) { + if ($line =~ /(\d+\.\d+\.\d+\.\d+):\d+/) { + $::proxies{$1} = 1; + } } } - my @wl=io('wordlist.txt')->getlines; - chomp @wl; - foreach my $item (@wl) { - $::wordlist{lc $item} = 1; + if (-e 'wordlist.txt') { + my @wl=io('wordlist.txt')->getlines; + chomp @wl; + foreach my $item (@wl) { + $::wordlist{lc $item} = 1; + } } $::fm = File::Monitor->new(); foreach my $file ("channels", "dnsbl", "mysql", "restrictions", "rules", "settings", "users", "blacklist") { -- cgit v1.2.3