adblock-fast: bugfixes: status & TLD check with unbound

fixes: https://github.com/openwrt/packages/issues/27146
supercedes: https://github.com/openwrt/packages/pull/27159

Signed-off-by: Stan Grishin <stangri@melmac.ca>
This commit is contained in:
Stan Grishin
2025-08-05 03:05:53 +00:00
parent 810341cf33
commit b8fa681098
2 changed files with 5 additions and 5 deletions

View File

@@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=adblock-fast PKG_NAME:=adblock-fast
PKG_VERSION:=1.1.4 PKG_VERSION:=1.1.4
PKG_RELEASE:=4 PKG_RELEASE:=5
PKG_MAINTAINER:=Stan Grishin <stangri@melmac.ca> PKG_MAINTAINER:=Stan Grishin <stangri@melmac.ca>
PKG_LICENSE:=AGPL-3.0-or-later PKG_LICENSE:=AGPL-3.0-or-later

View File

@@ -459,7 +459,7 @@ json() {
'get') 'get')
case "$param" in case "$param" in
'errors'|'warnings') 'errors'|'warnings')
json_select "$param" >/dev/null 2>&1 json_select "$param" >/dev/null 2>&1 || return
if [ -z "$value" ]; then if [ -z "$value" ]; then
json_get_keys i json_get_keys i
else else
@@ -1140,7 +1140,7 @@ resolver() {
sanity) sanity)
[ -n "$sanity_check" ] || return 0 [ -n "$sanity_check" ] || return 0
output_dns "Sanity check for $dns TLDs " output_dns "Sanity check for $dns TLDs "
if ! grep -q -v '\.' "$outputFile"; then if ! grep -qvE '\.|server:' "$outputFile"; then
output_ok output_ok
else else
json add warning 'warningSanityCheckTLD' "$outputFile" json add warning 'warningSanityCheckTLD' "$outputFile"
@@ -1985,7 +1985,7 @@ adb_check_tld() {
output "No block-list ('$outputFile') found.\n" output "No block-list ('$outputFile') found.\n"
return 0 return 0
fi fi
c="$(grep -c -v '\.' "$outputFile")" c="$(grep -cvE '\.|server:' "$outputFile")"
if [ "$c" -gt 0 ]; then if [ "$c" -gt 0 ]; then
if [ "$c" -eq 1 ]; then if [ "$c" -eq 1 ]; then
output 1 "Found 1 match for TLD in '$outputFile'.\n" output 1 "Found 1 match for TLD in '$outputFile'.\n"
@@ -1995,7 +1995,7 @@ adb_check_tld() {
output 2 "[PROC] Found $c matches for TLDs in '$outputFile'.\n" output 2 "[PROC] Found $c matches for TLDs in '$outputFile'.\n"
fi fi
if [ "$c" -le 20 ]; then if [ "$c" -le 20 ]; then
grep -v '\.' "$outputFile" | sed "$outputOutputFilter" grep -vE '\.|server:' "$outputFile" | sed "$outputOutputFilter"
fi fi
else else
output 1 "No TLD was found in current block-list ('$outputFile').\n" output 1 "No TLD was found in current block-list ('$outputFile').\n"