From 80bc44cb7b7c14f28db63707d9a4c59a430a70e3 Mon Sep 17 00:00:00 2001 From: Stan Grishin Date: Thu, 5 Oct 2023 14:51:51 +0000 Subject: [PATCH] adblock-fast: bugfix: properly identify hosts-files * escape dots in grep command to properly identify hosts files Signed-off-by: Stan Grishin (cherry picked from commit 13a88d0b79142f385d77baaa390211673bf6b9c0) --- net/adblock-fast/Makefile | 2 +- net/adblock-fast/files/etc/init.d/adblock-fast | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/net/adblock-fast/Makefile b/net/adblock-fast/Makefile index bd7ad9845b..f923a27b47 100644 --- a/net/adblock-fast/Makefile +++ b/net/adblock-fast/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=adblock-fast PKG_VERSION:=1.0.0 -PKG_RELEASE:=5 +PKG_RELEASE:=6 PKG_MAINTAINER:=Stan Grishin PKG_LICENSE:=GPL-3.0-or-later diff --git a/net/adblock-fast/files/etc/init.d/adblock-fast b/net/adblock-fast/files/etc/init.d/adblock-fast index f885bd1052..8229f0845d 100755 --- a/net/adblock-fast/files/etc/init.d/adblock-fast +++ b/net/adblock-fast/files/etc/init.d/adblock-fast @@ -282,7 +282,7 @@ append_url() { echo 'dnsmasq2' elif grep -q '^address=' "$file"; then echo 'dnsmasq3' - elif grep -q '^0.0.0.0' "$file" || grep -q '^127.0.0.1' "$file"; then + elif grep -q '^0\.0\.0\.0' "$file" || grep -q '^127\.0\.0\.1' "$file"; then echo 'hosts' elif [ -n "$(sed "$domainsFilter" "$file" | head -1)" ]; then echo 'domains' @@ -1536,6 +1536,7 @@ adb_start() { json_close_array procd_close_data procd_close_instance + return 0 } adb_status() { @@ -1568,12 +1569,13 @@ adb_status() { n=$((n+1)) done fi + return 0 } # shellcheck disable=SC2120 adb_stop() { local validation_result="$3" - load_environment "$validation_result" 'quiet' || return 1 + load_environment "$validation_result" 'quiet' || return 0 if [ -s "$outputFile" ]; then output "Stopping $serviceName... " cache 'create' @@ -1593,6 +1595,7 @@ adb_stop() { output "${_ERROR_}: $(get_text 'errorStopping')!\\n" fi fi + return 0 } adb_pause() { -- 2.30.2