adblock: update 3.5.1 5639/head
authorDirk Brenken <dev@brenken.org>
Tue, 20 Feb 2018 14:30:52 +0000 (15:30 +0100)
committerDirk Brenken <dev@brenken.org>
Tue, 20 Feb 2018 14:30:52 +0000 (15:30 +0100)
* maintenance update, just small backend bugfixes

Signed-off-by: Dirk Brenken <dev@brenken.org>
net/adblock/Makefile
net/adblock/files/adblock.init
net/adblock/files/adblock.sh

index 37936c1d4d363b915c1711aa1b34512241a540c1..677f7fd231d32d77a44c22c93e5515f971c5a525 100644 (file)
@@ -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 <dev@brenken.org>
index 5ca4d1176a8e9be0af9c5b6f064f95c51d59b06d..33aebbfee3570704662e9d54955c177e1a7eddfe 100755 (executable)
@@ -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
index 099cb6066c882403861199a627e66b878a95d301..96b2c3814bd72cd12645ac2d901611bb51618fc4 100755 (executable)
@@ -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=${!}