adblock: update 3.8.2 9788/head
authorDirk Brenken <dev@brenken.org>
Wed, 21 Aug 2019 09:16:43 +0000 (11:16 +0200)
committerDirk Brenken <dev@brenken.org>
Wed, 21 Aug 2019 09:16:43 +0000 (11:16 +0200)
* background service: no longer miss "signal" events for the
  dns backend (to trigger adblock)
* fix a dns backend reload issue during switch between
  different blocking modes
* domain query: report found domains only once in
  "null" blocking mode with IPv4 & IPv6 list entries

Signed-off-by: Dirk Brenken <dev@brenken.org>
net/adblock/Makefile
net/adblock/files/adblock.service
net/adblock/files/adblock.sh

index 812f4d556a4c90765723ae81c640e6771d35f843..23b319d17a71d2abf872a45881111caa9bda1850 100644 (file)
@@ -6,7 +6,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=adblock
-PKG_VERSION:=3.8.1
+PKG_VERSION:=3.8.2
 PKG_RELEASE:=1
 PKG_LICENSE:=GPL-3.0+
 PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
index 1265c139e31308e5fab85014f5c14d0b02073dfc..f48d1cf2c27de2eb84247970bc81359029d8a52b 100755 (executable)
@@ -21,7 +21,7 @@ if [ -x "${adb_ubus}" ] && [ -n "${adb_dns}" ]
 then
        logger -p "info" -t "adblock-${adb_basever}  [${$}]" "ubus/adblock service started"
        "${adb_ubus}" -S -M r -m invoke monitor | \
-               { grep -qF "\"method\":\"set\",\"data\":{\"name\":\"${adb_dns}\""; [ $? -eq 0 ] && /etc/init.d/adblock start; }
+               { grep -qE "\"method\":\"(set|signal)\",\"data\":\{\"name\":\"${adb_dns}\""; [ $? -eq 0 ] && /etc/init.d/adblock start; }
 else
        logger -p "err" -t "adblock-${adb_basever}  [${$}]" "can't start ubus/adblock service"
 fi
index 56032f957341e6d23cf3a39365d489d05afffac5..9949bdabf42366a8acec1fa2d92cc2380200549d 100755 (executable)
@@ -10,7 +10,7 @@
 #
 LC_ALL=C
 PATH="/usr/sbin:/usr/bin:/sbin:/bin"
-adb_ver="3.8.1"
+adb_ver="3.8.2"
 adb_sysver="unknown"
 adb_enabled=0
 adb_debug=0
@@ -320,6 +320,9 @@ f_uci()
                                        /etc/init.d/firewall reload >/dev/null 2>&1
                                ;;
                                *)
+                                       > "${adb_dnsdir}/${adb_dnsfile}"
+                                       f_count
+                                       f_jsnup "running"
                                        /etc/init.d/"${adb_dns}" reload >/dev/null 2>&1
                                ;;
                        esac
@@ -372,7 +375,7 @@ f_extconf()
                                if [ "${adb_enabled}" -eq 1 ] && [ -z "$(uci_get dhcp "@dnsmasq[${adb_dnsinstance}]" serversfile | grep -Fo "${adb_dnsdir}/${adb_dnsfile}")" ]
                                then
                                        uci_set dhcp "@dnsmasq[${adb_dnsinstance}]" serversfile "${adb_dnsdir}/${adb_dnsfile}"
-                                       if [ "${adb_enabled}" -eq 1 ] && [ -n "$(uci_get dhcp "@dnsmasq[${adb_dnsinstance}]" addnhosts | grep -Fo "${adb_dnsdir}/${adb_dnsfile}")" ]
+                                       if [ -n "$(uci_get dhcp "@dnsmasq[${adb_dnsinstance}]" addnhosts | grep -Fo "${adb_dnsdir}/${adb_dnsfile}")" ]
                                        then
                                                uci -q del_list dhcp.@dnsmasq[${adb_dnsinstance}].addnhosts="${adb_dnsdir}/${adb_dnsfile}"
                                        fi
@@ -385,7 +388,7 @@ f_extconf()
                                if [ "${adb_enabled}" -eq 1 ] && [ -z "$(uci_get dhcp "@dnsmasq[${adb_dnsinstance}]" addnhosts | grep -Fo "${adb_dnsdir}/${adb_dnsfile}")" ]
                                then
                                        uci -q add_list dhcp.@dnsmasq[${adb_dnsinstance}].addnhosts="${adb_dnsdir}/${adb_dnsfile}"
-                                       if [ "${adb_enabled}" -eq 1 ] && [ -n "$(uci_get dhcp "@dnsmasq[${adb_dnsinstance}]" serversfile | grep -Fo "${adb_dnsdir}/${adb_dnsfile}")" ]
+                                       if [ -n "$(uci_get dhcp "@dnsmasq[${adb_dnsinstance}]" serversfile | grep -Fo "${adb_dnsdir}/${adb_dnsfile}")" ]
                                        then
                                                uci_remove dhcp "@dnsmasq[${adb_dnsinstance}]" serversfile
                                        fi
@@ -506,7 +509,6 @@ f_dnsup()
                                        fi
                                ;;
                        esac
-                       sleep 1
                        adb_rc=0
                        break
                fi
@@ -735,7 +737,7 @@ f_query()
                                        field=2
                                elif [ "${adb_dnsvariant% *}" = "null" ]
                                then
-                                       prefix=".*[\\t\\.]"
+                                       prefix="0\\..*[\\t\\.]"
                                        suffix=""
                                        field=2
                                fi
@@ -1022,7 +1024,7 @@ f_main()
        adb_tmpfile="${tmp_file}"
        f_list merge
 
-       # overall sort and dns restart
+       # tld compression and dns restart
        #
        if [ -s "${adb_tmpdir}"/"${adb_dnsfile}" ]
        then