diff options
author | Janik Kleinhoff <ilbelkyr@shalture.org> | 2017-02-12 13:52:23 +0000 |
---|---|---|
committer | Janik Kleinhoff <ilbelkyr@shalture.org> | 2017-02-12 13:52:23 +0000 |
commit | e763ec8c425f73eb96adc5265ae1258b697a3ea6 (patch) | |
tree | f9fdc671993f324e7d3f3233cade0e31bfb9beb2 | |
parent | 27099e37b01af3c7d976aa8e2c97c3361969c6cc (diff) | |
download | antispammeta-e763ec8c425f73eb96adc5265ae1258b697a3ea6.tar.bz2 antispammeta-e763ec8c425f73eb96adc5265ae1258b697a3ea6.tar.xz antispammeta-e763ec8c425f73eb96adc5265ae1258b697a3ea6.tar.zst |
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.
-rwxr-xr-x | meta.pl | 30 |
1 files changed, 18 insertions, 12 deletions
@@ -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") { |