Browse Source

adblock: update 3.5.1

* maintenance update, just small backend bugfixes

Signed-off-by: Dirk Brenken <dev@brenken.org>
lilik-openwrt-22.03
Dirk Brenken 7 years ago
parent
commit
ba6d67883a
3 changed files with 31 additions and 27 deletions
  1. +1
    -1
      net/adblock/Makefile
  2. +4
    -4
      net/adblock/files/adblock.init
  3. +26
    -22
      net/adblock/files/adblock.sh

+ 1
- 1
net/adblock/Makefile View File

@ -6,7 +6,7 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=adblock PKG_NAME:=adblock
PKG_VERSION:=3.5.0
PKG_VERSION:=3.5.1
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>


+ 4
- 4
net/adblock/files/adblock.init View File

@ -26,7 +26,7 @@ start_service()
then then
if [ -n "${adb_boot}" ] if [ -n "${adb_boot}" ]
then then
local trigger="$(uci_get adblock.global.adb_trigger)"
local trigger="$(uci_get adblock global adb_trigger)"
if [ "${trigger}" != "timed" ] if [ "${trigger}" != "timed" ]
then then
return 0 return 0
@ -77,7 +77,7 @@ query()
status() status()
{ {
local key keylist value rtfile="$(uci_get adblock.extra.adb_rtfile)"
local key keylist value rtfile="$(uci_get adblock extra adb_rtfile)"
rtfile="${rtfile:-"/tmp/adb_runtime.json"}" rtfile="${rtfile:-"/tmp/adb_runtime.json"}"
if [ -s "${rtfile}" ] if [ -s "${rtfile}" ]
@ -98,8 +98,8 @@ status()
service_triggers() service_triggers()
{ {
local trigger="$(uci_get adblock.global.adb_trigger)"
local delay="$(uci_get adblock.extra.adb_triggerdelay)"
local trigger="$(uci_get adblock global adb_trigger)"
local delay="$(uci_get adblock extra adb_triggerdelay)"
if [ "${trigger}" != "none" ] && [ "${trigger}" != "timed" ] if [ "${trigger}" != "none" ] && [ "${trigger}" != "timed" ]
then then


+ 26
- 22
net/adblock/files/adblock.sh View File

@ -10,7 +10,7 @@
# #
LC_ALL=C LC_ALL=C
PATH="/usr/sbin:/usr/bin:/sbin:/bin" PATH="/usr/sbin:/usr/bin:/sbin:/bin"
adb_ver="3.5.0"
adb_ver="3.5.1"
adb_sysver="unknown" adb_sysver="unknown"
adb_enabled=0 adb_enabled=0
adb_debug=0 adb_debug=0
@ -398,7 +398,7 @@ f_extconf()
uci -q set resolver.kresd.keep_cache="1" uci -q set resolver.kresd.keep_cache="1"
elif [ ${adb_enabled} -eq 0 ] || ([ ${adb_dnsflush} -eq 1 ] && [ "$(uci -q get resolver.kresd.keep_cache)" = "1" ]) elif [ ${adb_enabled} -eq 0 ] || ([ ${adb_dnsflush} -eq 1 ] && [ "$(uci -q get resolver.kresd.keep_cache)" = "1" ])
then then
uci -q delete resolver.kresd.keep_cache
uci -q set resolver.kresd.keep_cache="0"
fi fi
;; ;;
esac esac
@ -657,7 +657,7 @@ f_switch()
then then
f_temp f_temp
f_dnsup f_dnsup
f_jsnup
f_jsnup "${mode}"
f_log "info" "${mode} adblock processing" f_log "info" "${mode} adblock processing"
f_rmtemp f_rmtemp
exit 0 exit 0
@ -698,29 +698,33 @@ f_query()
# #
f_jsnup() f_jsnup()
{ {
local bg_pid rundate status="${1}" mode="normal mode"
local bg_pid rundate="$(/bin/date "+%d.%m.%Y %H:%M:%S")" status="${1:-"enabled"}" mode="normal mode" no_mail=0
if [ -z "${status}" ]
if [ ${adb_rc} -gt 0 ]
then then
rundate="$(/bin/date "+%d.%m.%Y %H:%M:%S")"
if [ ${adb_rc} -gt 0 ]
then
status="error"
elif [ ${adb_enabled} -eq 0 ]
then
status="disabled"
elif [ -s "${adb_dnsdir}/.${adb_dnsfile}" ]
then
status="paused"
else
status="enabled"
f_count
fi
status="error"
fi
if [ ${adb_enabled} -eq 0 ]
then
status="disabled"
fi
if [ "${status}" = "suspend" ]
then
status="paused"
fi
if [ "${status}" = "resume" ]
then
no_mail=1
status="enabled"
fi
if [ "${status}" = "enabled" ]
then
f_count
fi fi
if [ ${adb_backup_mode} -eq 1 ] if [ ${adb_backup_mode} -eq 1 ]
then then
mode="normal/backup mode"
mode="backup mode"
fi fi
if [ -z "${adb_fetchinfo}" ] && [ -s "${adb_rtfile}" ] if [ -z "${adb_fetchinfo}" ] && [ -s "${adb_rtfile}" ]
@ -742,8 +746,8 @@ f_jsnup()
json_close_object json_close_object
json_dump > "${adb_rtfile}" json_dump > "${adb_rtfile}"
if [ ${adb_notify} -eq 1 ] && [ -x /etc/adblock/adblock.notify ] && ([ "${status}" = "error" ] ||\
([ "${status}" = "enabled" ] && [ ${adb_cnt} -le ${adb_notifycnt} ]))
if [ ${adb_notify} -eq 1 ] && [ ${no_mail} -eq 0 ] && [ -x /etc/adblock/adblock.notify ] && \
([ "${status}" = "error" ] || ([ "${status}" = "enabled" ] && [ ${adb_cnt} -le ${adb_notifycnt} ]))
then then
(/etc/adblock/adblock.notify >/dev/null 2>&1) & (/etc/adblock/adblock.notify >/dev/null 2>&1) &
bg_pid=${!} bg_pid=${!}


Loading…
Cancel
Save