From 8a2fd2555ab5af0bfdc5fac7a3f8719dda994603 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 29 Jan 2022 20:26:27 +0100 Subject: fix --- openbsd/frontends/scripts/sitestats.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'openbsd/frontends/scripts/sitestats.sh') diff --git a/openbsd/frontends/scripts/sitestats.sh b/openbsd/frontends/scripts/sitestats.sh index 1cd60c6..8a8a31b 100755 --- a/openbsd/frontends/scripts/sitestats.sh +++ b/openbsd/frontends/scripts/sitestats.sh @@ -38,8 +38,8 @@ filter () { # 1. You visit 2 sites within one single second # 2. You try to call an odd file or path cut -d, -f2,3,6,7 $STATSFILE | - perl -l -n -e '$s{$_}++ if /\.suffix/; - $s{$_}+=1000 if /(?:\.php|\.env|robots\.txt|\/wp|\/wordpress\/|\/\.git\/|HNAP)/; + perl -l -n -e '($k)=m/(.*?,.*?,.*?),/; $s{$k}++ if /\.suffix/; + $s{$k}+=1000 if /(?:\.php|\.env|robots\.txt|\/wp|\/wordpress\/|\/\.git\/|HNAP)/; END { while (($k,$v) = each %s) { print $k =~ /.*?,(.*?),/ if $v > 1 } }' | sort -u > $BOTSFILE grep -F -v -f $BOTSFILE $STATSFILE > $STATSFILE.clean -- cgit v1.2.3