diff --git a/net/adblock/Makefile b/net/adblock/Makefile index 37936c1d4d..677f7fd231 100644 --- a/net/adblock/Makefile +++ b/net/adblock/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=adblock -PKG_VERSION:=3.5.0 +PKG_VERSION:=3.5.1 PKG_RELEASE:=1 PKG_LICENSE:=GPL-3.0+ PKG_MAINTAINER:=Dirk Brenken diff --git a/net/adblock/files/adblock.init b/net/adblock/files/adblock.init index 5ca4d1176a..33aebbfee3 100755 --- a/net/adblock/files/adblock.init +++ b/net/adblock/files/adblock.init @@ -26,7 +26,7 @@ start_service() then if [ -n "${adb_boot}" ] then - local trigger="$(uci_get adblock.global.adb_trigger)" + local trigger="$(uci_get adblock global adb_trigger)" if [ "${trigger}" != "timed" ] then return 0 @@ -77,7 +77,7 @@ query() 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"}" if [ -s "${rtfile}" ] @@ -98,8 +98,8 @@ status() 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" ] then diff --git a/net/adblock/files/adblock.sh b/net/adblock/files/adblock.sh index 099cb6066c..96b2c3814b 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="3.5.0" +adb_ver="3.5.1" adb_sysver="unknown" adb_enabled=0 adb_debug=0 @@ -398,7 +398,7 @@ f_extconf() 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" ]) then - uci -q delete resolver.kresd.keep_cache + uci -q set resolver.kresd.keep_cache="0" fi ;; esac @@ -657,7 +657,7 @@ f_switch() then f_temp f_dnsup - f_jsnup + f_jsnup "${mode}" f_log "info" "${mode} adblock processing" f_rmtemp exit 0 @@ -698,29 +698,33 @@ f_query() # 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 - 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 if [ ${adb_backup_mode} -eq 1 ] then - mode="normal/backup mode" + mode="backup mode" fi if [ -z "${adb_fetchinfo}" ] && [ -s "${adb_rtfile}" ] @@ -742,8 +746,8 @@ f_jsnup() json_close_object 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 (/etc/adblock/adblock.notify >/dev/null 2>&1) & bg_pid=${!}