summaryrefslogtreecommitdiff
path: root/openbsd
diff options
context:
space:
mode:
authorPaul Buetow <openbsd@mx.buetow.org>2022-01-29 20:26:27 +0100
committerPaul Buetow <openbsd@mx.buetow.org>2022-01-29 20:26:27 +0100
commit8a2fd2555ab5af0bfdc5fac7a3f8719dda994603 (patch)
treec0600a8331d1f7db017e1beb84f0916a10f9a849 /openbsd
parent6192562bb42dfd3c394c268d8f3a8b6d067c024b (diff)
fix
Diffstat (limited to 'openbsd')
-rwxr-xr-xopenbsd/frontends/scripts/sitestats.sh4
1 files changed, 2 insertions, 2 deletions
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