mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 07:28:39 +01:00
adblock: update 3.4.1
* enable code to support Turris Omnia forthcoming upstream change (new kresd 'keep_cache' option) to preserve kresd DNS cache * fix a 'status' race condition while the adblock process is running in parallel * various small speed improvements * rework debug output * refine blacklist handling * enable the (empty) blacklist source in the default config * email notification supports mstmp, even without sendmail symlink * email notification writes minimal status to log (one-liner) * LuCI: refine logfile search term * LuCI: Textarea 'autoscroll down' in logfile view * LuCI: Left-align blocklist source table plus a more compact design Signed-off-by: Dirk Brenken <dev@brenken.org>
This commit is contained in:
@@ -72,17 +72,31 @@ query()
|
||||
|
||||
status()
|
||||
{
|
||||
rc_procd "${adb_script}" status
|
||||
local key keylist value rtfile="$(uci_get adblock.extra.adb_rtfile)"
|
||||
|
||||
rtfile="${rtfile:-"/tmp/adb_runtime.json"}"
|
||||
if [ -s "${rtfile}" ]
|
||||
then
|
||||
printf "%s\n" "::: adblock runtime information"
|
||||
json_load "$(cat "${rtfile}" 2>/dev/null)"
|
||||
json_select data
|
||||
json_get_keys keylist
|
||||
for key in ${keylist}
|
||||
do
|
||||
json_get_var value "${key}"
|
||||
printf " + %-15s : %s\n" "${key}" "${value}"
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
local trigger="$(uci_get adblock.global.adb_trigger)"
|
||||
local delay="$(uci_get adblock.global.adb_triggerdelay)"
|
||||
local delay="$(uci_get adblock.extra.adb_triggerdelay)"
|
||||
|
||||
if [ "${trigger}" != "none" ] && [ "${trigger}" != "timed" ]
|
||||
then
|
||||
PROCD_RELOAD_DELAY=$((${delay:-1} * 1000))
|
||||
PROCD_RELOAD_DELAY=$((${delay:-2} * 1000))
|
||||
procd_add_interface_trigger "interface.*.up" "${trigger}" "${adb_init}" start
|
||||
fi
|
||||
procd_add_reload_trigger "adblock"
|
||||
|
||||
Reference in New Issue
Block a user