banip: refine/fix nginx search pattern
* fix issue with nginx search pattern reported in forum support thread Signed-off-by: Dirk Brenken <dev@brenken.org>
This commit is contained in:
parent
89e9a1a634
commit
0c16840e26
2 changed files with 3 additions and 3 deletions
|
@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
|
|||
|
||||
PKG_NAME:=banip
|
||||
PKG_VERSION:=0.7.9
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
PKG_LICENSE:=GPL-3.0-or-later
|
||||
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
|
||||
|
||||
|
|
|
@ -1254,11 +1254,11 @@ f_main()
|
|||
fi
|
||||
if [ -n "$(printf "%s\n" "${ban_logterms}" | grep -F "nginx")" ]
|
||||
then
|
||||
log_ips="$(printf "%s\n" "${log_raw}" | grep -oE "nginx\[[0-9]+\]:.*\[error\].*open().*client: [[:alnum:].:]+" | \
|
||||
log_ips="$(printf "%s\n" "${log_raw}" | grep -oE "nginx(\[[0-9]+\])?:.*\[error\].*open\(\).*client: [[:alnum:].:]+" | \
|
||||
awk '!seen[$NF]++' | awk '{ORS=" ";print $NF}')"
|
||||
for ip in ${log_ips}
|
||||
do
|
||||
log_count="$(printf "%s\n" "${log_raw}" | grep -cE "nginx\[[0-9]+\]:.*\[error\].*open().*client: ${ip}")"
|
||||
log_count="$(printf "%s\n" "${log_raw}" | grep -cE "nginx(\[[0-9]+\])?:.*\[error\].*open\(\).*client: ${ip}")"
|
||||
if [ "${log_count}" -ge "${ban_nginx_logcount}" ]
|
||||
then
|
||||
log_merge="${log_merge} ${ip}"
|
||||
|
|
Loading…
Reference in a new issue