banip: update 0.8.9-4
authorDirk Brenken <dev@brenken.org>
Sun, 9 Jul 2023 05:01:17 +0000 (07:01 +0200)
committerDirk Brenken <dev@brenken.org>
Sun, 9 Jul 2023 05:01:17 +0000 (07:01 +0200)
* made the etag id parsing more bulletproof (to catch unverified etags as well)

Signed-off-by: Dirk Brenken <dev@brenken.org>
net/banip/Makefile
net/banip/files/banip-functions.sh

index ebc88007d572d041435126bc8227783107214925..a9900dbdf3778e084bfc6cad362b3e43d81a3057 100644 (file)
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=banip
 PKG_VERSION:=0.8.9
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 PKG_LICENSE:=GPL-3.0-or-later
 PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
 
index ad642ee129586ecb726a725d7794f3cfbc85021d..170c7326ce6431e498689e8a155b2bcd0bd6b171 100644 (file)
@@ -515,7 +515,7 @@ f_etag() {
                [ ! -f "${ban_backupdir}/banIP.etag" ] && : >"${ban_backupdir}/banIP.etag"
                http_head="$("${ban_fetchcmd}" ${ban_etagparm} "${feed_url}" 2>&1)"
                http_code="$(printf "%s" "${http_head}" | "${ban_awkcmd}" 'tolower($0)~/^http\/[0123\.]+ /{printf "%s",$2}')"
-               etag_id="$(printf "%s" "${http_head}" | "${ban_awkcmd}" '{FS="\""}tolower($0)~/^[[:space:]]*etag: /{printf "%s",$2}')"
+               etag_id="$(printf "%s" "${http_head}" | "${ban_awkcmd}" 'tolower($0)~/^[[:space:]]*etag: /{gsub("\"","");printf "%s",$2}')"
                etag_rc="${?}"
 
                if [ "${http_code}" = "404" ] || { [ "${etag_rc}" = "0" ] && [ -n "${etag_id}" ] && "${ban_grepcmd}" -q "^${feed}${feed_suffix}.*${etag_id}\$" "${ban_backupdir}/banIP.etag"; }; then