From df0f552ef290b6d5f1ad51d1fa4fd348c4950c62 Mon Sep 17 00:00:00 2001 From: sceox Date: Sat, 28 Nov 2020 09:45:41 -0800 Subject: [PATCH] handle difference in bsd vs linux tail options --- q2a_usercheck.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/q2a_usercheck.sh b/q2a_usercheck.sh index 8f0dc1b..031f6ad 100755 --- a/q2a_usercheck.sh +++ b/q2a_usercheck.sh @@ -2,10 +2,11 @@ logf='/var/log/nginx/access.log' cache='/tmp/forumspam_cache' +tail_opts='-F' # set to `-f` on OpenBSD! test -f $cache || install -m 600 /dev/null $cache -tail -F $logf | while read line ; do +tail $tail_opts $logf | while read line ; do case $line in (*"POST"*) ip=`echo $line | awk '{print $1}'` ip_regex=`echo $ip | sed 's/\./\\./g'`