This repository has been archived on 2025-03-03. You can view files and clone it, but cannot push or open issues or pull requests.
q2a-antispam/q2a_usercheck.sh

17 lines
314 B
Bash
Executable File

#!/bin/sh
logf='/var/log/nginx/access.log'
cache='/tmp/forumspam_cache'
install -m 600 /dev/null $cache
tail -F $logf | while read line ; do
case $line in (*"POST"*)
ip=`echo $line | awk '{print $1}'`
if ! grep -q $ip $cache; then
echo $ip >> $cache
/usr/local/bin/forumspam.sh "$ip"
fi
esac
done