adblock-fast: bugfix: detect_file_type()
authorStan Grishin <[email protected]>
Sun, 23 Feb 2025 23:33:31 +0000 (23:33 +0000)
committerStan Grishin <[email protected]>
Sat, 1 Mar 2025 17:57:10 +0000 (09:57 -0800)
* 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 <[email protected]>
net/adblock-fast/Makefile
net/adblock-fast/files/etc/init.d/adblock-fast

index 7bc4e5ae83ab86e3f1d1d8f9d2a4e2db71651b67..d0cce9f31d78a99b469ca3a0bd55e230be42eabf 100644 (file)
@@ -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 <[email protected]>
 PKG_LICENSE:=AGPL-3.0-or-later
 
index d10e4ae1ee9be75c5adf736a470f5ec823ebce22..ffa2817d18d6c532afd5d2cac59076fe21db40ce 100755 (executable)
@@ -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'