From f19bf22b3c421ae42a0c63c47910ea8556f2f49e Mon Sep 17 00:00:00 2001 From: Stan Grishin Date: Sun, 23 Feb 2025 23:33:31 +0000 Subject: [PATCH] adblock-fast: bugfix: detect_file_type() * Properly detect domain lists, fixes https://github.com/openwrt/packages/issues/25973 Thanks @timfeierabend * Better output when setting triggers * No wait for ubus network.interface on boot Signed-off-by: Stan Grishin --- net/adblock-fast/Makefile | 2 +- net/adblock-fast/files/etc/init.d/adblock-fast | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/net/adblock-fast/Makefile b/net/adblock-fast/Makefile index 7bc4e5ae8..d0cce9f31 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.1.3 -PKG_RELEASE:=1 +PKG_RELEASE:=5 PKG_MAINTAINER:=Stan Grishin PKG_LICENSE:=AGPL-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 d10e4ae1e..ffa2817d1 100755 --- a/net/adblock-fast/files/etc/init.d/adblock-fast +++ b/net/adblock-fast/files/etc/init.d/adblock-fast @@ -638,7 +638,7 @@ detect_file_type() { 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 -e '^0\.0\.0\.0\s' -e '^127\.0\.0\.1\s' "$file"; then echo 'hosts' elif [ -n "$(sed "$domainsFilter" "$file" | head -1)" ]; then echo 'domains' @@ -2258,7 +2258,7 @@ adb_pause() { allow() { load_validate_config 'config' adb_allow "'$*'"; } boot() { - ubus -t 30 wait_for network.interface 2>/dev/null +# ubus -t 30 wait_for network.interface 2>/dev/null adbf_boot_flag=1 rc_procd start_service 'on_boot' && service_started 'on_boot' } @@ -2311,7 +2311,7 @@ service_triggers() { wan6="${wan6:-wan6}" fi output "Setting trigger${wan6:+s} for $wan ${wan6:+$wan6 }" - for i in "$wan" "$wan6"; do + for i in $wan $wan6; do procd_add_interface_trigger "interface.*" "$i" "/etc/init.d/${packageName}" start && output_ok || output_fail done output '\n'