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
2020-09-06 11:21:40 -07:00

17 lines
332 B
Bash
Executable File

#!/bin/sh
logf='/var/log/nginx/access.log'
cache='/tmp/forumspam_cache'
test -f $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