From 035d0b30bba362d4db5ec6717c051f377ce654ee Mon Sep 17 00:00:00 2001 From: Joe Date: Sat, 30 Apr 2022 01:38:42 +0200 Subject: Added bot list to kill the bots --- src/cron/counter.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cron/counter.sh b/src/cron/counter.sh index fdc5f18..b75dd12 100755 --- a/src/cron/counter.sh +++ b/src/cron/counter.sh @@ -3,7 +3,8 @@ logfile='/var/log/nginx/access.log' destfile='/usr/local/www/jozan/index.html' foretext='Unique visitors: ' +botlist='petalbot|googlebot|adsbot-google|ahrefs\.com|pingbot|robots\.txt|pandalytics|serpstatbot|zoombot|semrush.com\/bot|archive\.org_bot|bingbot|vuhuvbot|neevabot|botaflatoon|botfnetowrksx|zaldamosearchbot|facebookexternalhit|mj12bot|polaris botnet|turnitinbot' [ -e $logfile ] || exit 1 [ -e $destfile ] || exit 1 -sed -i '' "s/$foretext.*$/$foretext$(awk '{print $1}' $logfile | sort | uniq | wc -l | tr -d ' ')<\/b>/" $destfile +sed -i '' "s/$foretext.*$/$foretext$(grep -E -v -i "$botlist" $logfile | awk '{print $1}' | sort | uniq | wc -l | tr -d ' ')<\/b>/" $destfile -- cgit v1.2.3