diff --git a/forumspam.sh b/forumspam.sh index 1f85f7f..9891231 100755 --- a/forumspam.sh +++ b/forumspam.sh @@ -10,18 +10,23 @@ curl 'http://api.stopforumspam.org/api?ip='$ip 2>/dev/null > $repl if ! grep -q '' $repl; then echo error failed to query stopforumspam api >> $logf + rm $repl exit 1 fi if ! grep -q 'yes' $repl; then + rm $repl exit 0 fi freq=`grep '' $repl | sed 's///; s!!!'` if [ "$freq" -ge 1 ]; then if ufw deny from $ip >/dev/null; then echo `date` blocked ip $ip with freq $freq >> $logf + rm $repl exit 0 else echo error failed to add ufw rule >> $logf + rm $repl exit 2 fi fi +rm $repl