Browse Source

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>
lilik-openwrt-22.03
Dirk Brenken 3 years ago
parent
commit
0c16840e26
No known key found for this signature in database GPG Key ID: 9D71CD547BFAE684
2 changed files with 3 additions and 3 deletions
  1. +1
    -1
      net/banip/Makefile
  2. +2
    -2
      net/banip/files/banip.sh

+ 1
- 1
net/banip/Makefile View File

@ -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>


+ 2
- 2
net/banip/files/banip.sh View File

@ -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…
Cancel
Save