adblock: update 1.3.3
* enable automatic restore on empty source downloads Signed-off-by: Dirk Brenken <dev@brenken.org>
This commit is contained in:
parent
4bb8a34bbf
commit
7ebd92f997
3 changed files with 20 additions and 7 deletions
|
@ -7,7 +7,7 @@
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=adblock
|
PKG_NAME:=adblock
|
||||||
PKG_VERSION:=1.3.2
|
PKG_VERSION:=1.3.3
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
PKG_LICENSE:=GPL-3.0+
|
PKG_LICENSE:=GPL-3.0+
|
||||||
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
|
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
|
||||||
|
|
|
@ -58,7 +58,7 @@ A lot of people already use adblocker plugins within their desktop browsers, but
|
||||||
* status & error logging to stdout and syslog
|
* status & error logging to stdout and syslog
|
||||||
* use two dynamic uhttpd instances as adblock pixel server, separated for ads delivered on port 80 and on port 443
|
* use two dynamic uhttpd instances as adblock pixel server, separated for ads delivered on port 80 and on port 443
|
||||||
* use dynamic iptables chains/rulesets for adblock related redirects/rejects
|
* use dynamic iptables chains/rulesets for adblock related redirects/rejects
|
||||||
* init system support (start/stop/restart/reload/toggle)
|
* init system support (start/stop/restart/reload/toggle/stats/cfgup)
|
||||||
* hotplug support, the adblock start will be triggered by wan 'ifup' event
|
* hotplug support, the adblock start will be triggered by wan 'ifup' event
|
||||||
* adblock toggle to quickly switch adblocking 'on' or 'off'
|
* adblock toggle to quickly switch adblocking 'on' or 'off'
|
||||||
* optional: automatic adblock list backup/restore, backups will be (de-)compressed on the fly (disabled by default)
|
* optional: automatic adblock list backup/restore, backups will be (de-)compressed on the fly (disabled by default)
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#
|
#
|
||||||
adb_pid="${$}"
|
adb_pid="${$}"
|
||||||
adb_pidfile="/var/run/adblock.pid"
|
adb_pidfile="/var/run/adblock.pid"
|
||||||
adb_scriptver="1.3.2"
|
adb_scriptver="1.3.3"
|
||||||
adb_mincfgver="2.2"
|
adb_mincfgver="2.2"
|
||||||
adb_scriptdir="${0%/*}"
|
adb_scriptdir="${0%/*}"
|
||||||
if [ -r "${adb_pidfile}" ]
|
if [ -r "${adb_pidfile}" ]
|
||||||
|
@ -145,10 +145,23 @@ do
|
||||||
unset tmp_domains
|
unset tmp_domains
|
||||||
elif [ $((rc)) -eq 0 ] && [ -z "${tmp_domains}" ]
|
elif [ $((rc)) -eq 0 ] && [ -z "${tmp_domains}" ]
|
||||||
then
|
then
|
||||||
|
if [ "${backup_ok}" = "true" ] && [ -r "${adb_dir_backup}/${adb_dnsprefix}.${src_name}.gz" ]
|
||||||
|
then
|
||||||
|
gunzip -cf "${adb_dir_backup}/${adb_dnsprefix}.${src_name}.gz" > "${adb_tmpfile}"
|
||||||
|
count="$(wc -l < "${adb_tmpfile}")"
|
||||||
|
"${adb_uci}" -q set "adblock.${src_name}.adb_src_timestamp=list restored"
|
||||||
|
f_log " empty source download, restored (${count} entries)"
|
||||||
|
else
|
||||||
|
if [ -r "${adb_dnsdir}/${adb_dnsprefix}.${src_name}" ]
|
||||||
|
then
|
||||||
|
rm -f "${adb_dnsdir}/${adb_dnsprefix}.${src_name}"
|
||||||
|
rm_done="true"
|
||||||
|
fi
|
||||||
"${adb_uci}" -q delete "adblock.${src_name}.adb_src_count"
|
"${adb_uci}" -q delete "adblock.${src_name}.adb_src_count"
|
||||||
"${adb_uci}" -q set "adblock.${src_name}.adb_src_timestamp=empty download"
|
"${adb_uci}" -q set "adblock.${src_name}.adb_src_timestamp=empty download"
|
||||||
f_log " empty source download, skipped"
|
f_log " empty source download, skipped"
|
||||||
continue
|
continue
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
rc=0
|
rc=0
|
||||||
if [ "${backup_ok}" = "true" ] && [ -r "${adb_dir_backup}/${adb_dnsprefix}.${src_name}.gz" ]
|
if [ "${backup_ok}" = "true" ] && [ -r "${adb_dir_backup}/${adb_dnsprefix}.${src_name}.gz" ]
|
||||||
|
|
Loading…
Reference in a new issue