adblock: update 4.4.4-3
authorDirk Brenken <[email protected]>
Thu, 4 Dec 2025 21:17:44 +0000 (22:17 +0100)
committerDirk Brenken <[email protected]>
Thu, 4 Dec 2025 21:20:23 +0000 (22:20 +0100)
* fixed a typo in the allowlist/blocklist regex
* limit the f_switch function to only the suspend/resume actions

Signed-off-by: Dirk Brenken <[email protected]>
net/adblock/Makefile
net/adblock/files/adblock.sh

index 328ebcba2266bf87496046ef8d7106d6eedb6f46..489b62c5bce951602923a59fdd6849195ebf5ec8 100644 (file)
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=adblock
 PKG_VERSION:=4.4.4
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 PKG_LICENSE:=GPL-3.0-or-later
 PKG_MAINTAINER:=Dirk Brenken <[email protected]>
 
index df7bc8cab98bbeb0de5a2f0dc14a41e444ba6dfe..89ef22b1bde23a201b6a7f026f60ac24b27a8bc9 100755 (executable)
@@ -703,7 +703,7 @@ f_list() {
                        ;;
                "blocklist" | "allowlist")
                        src_name="${mode}"
-                       rset="/^(([[:alnum:]_-]{1,63}\.)*[[:alpha:]][[:alnum:]-]{1,62}([[:space:]]|$))/{print tolower(\$1)}"
+                       rset="/^(([[:alnum:]_-]{1,63}\\.)*[[:alpha:]][[:alnum:]-]{1,62}([[:space:]]|$))/{print tolower(\$1)}"
                        case "${src_name}" in
                                "blocklist")
                                        if [ -f "${adb_blocklist}" ]; then
@@ -927,14 +927,14 @@ f_tld() {
 # suspend/resume adblock processing
 #
 f_switch() {
-       local status entry done="false" mode="${1}"
+       local status done="false" mode="${1}"
 
        json_init
        json_load_file "${adb_rtfile}" >/dev/null 2>&1
        json_select "data" >/dev/null 2>&1
        json_get_var status "adblock_status"
        f_env
-       if [ "${mode}" = "suspend" ] && [ "${status}" = "enabled" ]; then
+       if [ "${status}" = "enabled" ] && [ "${mode}" = "suspend" ]; then
                if [ "${adb_dnsshift}" = "0" ] && [ -f "${adb_finaldir}/${adb_dnsfile}" ]; then
                        mv -f "${adb_finaldir}/${adb_dnsfile}" "${adb_backupdir}/${adb_dnsfile}"
                        printf "%b" "${adb_dnsheader}" >"${adb_finaldir}/${adb_dnsfile}"
@@ -944,14 +944,14 @@ f_switch() {
                        printf "%b" "${adb_dnsheader}" >"${adb_dnsdir}/${adb_dnsfile}"
                        done="true"
                fi
-       elif [ "${mode}" = "resume" ] && [ "${status}" = "paused" ]; then
+       elif [ "${status}" = "paused" ] && [ "${mode}" = "resume" ]; then
                if [ "${adb_dnsshift}" = "0" ] && [ -f "${adb_backupdir}/${adb_dnsfile}" ]; then
                        mv -f "${adb_backupdir}/${adb_dnsfile}" "${adb_finaldir}/${adb_dnsfile}"
-                       f_count "resume" "${adb_finaldir}/${adb_dnsfile}"
+                       f_count "switch" "${adb_finaldir}/${adb_dnsfile}"
                        done="true"
                elif [ "${adb_dnsshift}" = "1" ] && [ ! -L "${adb_finaldir}/${adb_dnsfile}" ]; then
                        ln -fs "${adb_finaldir}/${adb_dnsfile}" "${adb_dnsdir}/${adb_dnsfile}"
-                       f_count "resume" "${adb_finaldir}/${adb_dnsfile}"
+                       f_count "switch" "${adb_finaldir}/${adb_dnsfile}"
                        done="true"
                fi
        fi
@@ -959,11 +959,11 @@ f_switch() {
                f_dnsup
                f_jsnup "${mode}"
                f_log "info" "${mode} adblock service"
-               f_rmtemp
        else
-               f_jsnup "stopped"
-               f_rmdns
+               f_count "switch" "${adb_finaldir}/${adb_dnsfile}"
+               f_jsnup "${status}"
        fi
+       f_rmtemp
 }
 
 # query blocklist for certain (sub-)domains