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>
This commit is contained in:
parent
e2af11adeb
commit
acafc3c40e
2 changed files with 14 additions and 6 deletions
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue