aboutsummaryrefslogtreecommitdiff
path: root/net/adblock
diff options
context:
space:
mode:
authorDirk Brenken <dev@brenken.org>2017-06-29 15:34:18 +0200
committerDirk Brenken <dev@brenken.org>2017-06-29 15:34:18 +0200
commitacafc3c40e31e3187fa88e3a1fde6d2047c1d461 (patch)
tree32dc8617bd6ff3e219154a91ed9af2a0ce945e6b /net/adblock
parente2af11adeb15df8972c91e120a7d66e8eb2f5d07 (diff)
adblock: update 2.8.2
* made DNS restart conditional (compare list hash values), to prevent needless restarts of the DNS backend Signed-off-by: Dirk Brenken <dev@brenken.org>
Diffstat (limited to 'net/adblock')
-rw-r--r--net/adblock/Makefile2
-rwxr-xr-xnet/adblock/files/adblock.sh18
2 files changed, 14 insertions, 6 deletions
diff --git a/net/adblock/Makefile b/net/adblock/Makefile
index 5141a7607..4b387977e 100644
--- a/net/adblock/Makefile
+++ b/net/adblock/Makefile
@@ -6,7 +6,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=adblock
-PKG_VERSION:=2.8.1
+PKG_VERSION:=2.8.2
PKG_RELEASE:=1
PKG_LICENSE:=GPL-3.0+
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
diff --git a/net/adblock/files/adblock.sh b/net/adblock/files/adblock.sh
index 04c19066b..7c3112877 100755
--- a/net/adblock/files/adblock.sh
+++ b/net/adblock/files/adblock.sh
@@ -10,7 +10,7 @@
#
LC_ALL=C
PATH="/usr/sbin:/usr/bin:/sbin:/bin"
-adb_ver="2.8.1"
+adb_ver="2.8.2"
adb_sysver="$(ubus -S call system board | jsonfilter -e '@.release.description')"
adb_enabled=1
adb_debug=0
@@ -436,7 +436,7 @@ f_log()
#
f_main()
{
- local src_name src_rset shalla_archive enabled url cnt=0
+ local src_name src_rset shalla_archive enabled url hash_old hash_new cnt=0
local mem_total="$(awk '/^MemTotal/ {print int($2/1000)}' "/proc/meminfo")"
f_log "info " "start adblock processing ..."
@@ -535,8 +535,12 @@ f_main()
fi
done
- # overall sort
+ # hash preparation & overall sort
#
+ if [ -f "${adb_dnsdir}/${adb_dnsfile}" ]
+ then
+ hash_old="$(sha256sum "${adb_dnsdir}/${adb_dnsfile}" | awk '{print $1}')"
+ fi
if [ -s "${adb_tmpdir}/${adb_dnsfile}" ]
then
if [ ${mem_total} -ge 64 ] || [ ${adb_forcesrt} -eq 1 ]
@@ -548,13 +552,17 @@ f_main()
else
> "${adb_dnsdir}/${adb_dnsfile}"
fi
+ hash_new="$(sha256sum "${adb_dnsdir}/${adb_dnsfile}" | awk '{print $1}')"
cnt="$(wc -l < "${adb_dnsdir}/${adb_dnsfile}")"
- # restart the dns backend and export runtime information
+ # conditional restart of the dns backend and runtime information export
#
chown "${adb_dns}":"${adb_dns}" "${adb_dnsdir}/${adb_dnsfile}" 2>/dev/null
f_rmtemp
- f_dnsrestart
+ if [ "${hash_old}" != "${hash_new}" ]
+ then
+ f_dnsrestart
+ fi
if [ ${?} -eq 0 ]
then
json_init