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:
@@ -10,10 +10,16 @@
|
||||
|
||||
LC_ALL=C
|
||||
PATH="/usr/sbin:/usr/bin:/sbin:/bin"
|
||||
mail_daemon="$(command -v sendmail)"
|
||||
mail_ver="1.0.0"
|
||||
mail_daemon="$(command -v msmtp)"
|
||||
mail_profile="adb_notify"
|
||||
mail_debug="--debug"
|
||||
mail_rc=0
|
||||
mail_rc=1
|
||||
|
||||
if [ ! -x "${mail_daemon}" ]
|
||||
then
|
||||
mail_daemon="$(command -v sendmail)"
|
||||
fi
|
||||
|
||||
# mail header
|
||||
#
|
||||
@@ -32,7 +38,11 @@ mail_text="${mail_text}\n\n++\n++ Adblock Information ++\n++\n$(/etc/init.d/adbl
|
||||
#
|
||||
if [ -x "${mail_daemon}" ]
|
||||
then
|
||||
printf "%b" "${mail_head}${mail_text}" | "${mail_daemon}" ${mail_debug} -a "${mail_profile}" "${mail_receiver}" 2>&1
|
||||
printf "%b" "${mail_head}${mail_text}" 2>/dev/null | "${mail_daemon}" ${mail_debug} -a "${mail_profile}" "${mail_receiver}" >/dev/null 2>&1
|
||||
mail_rc=${?}
|
||||
logger -p "info" -t "adblock-notify-[${mail_ver}]" "mail sent to '${mail_receiver}' with rc '${mail_rc}'"
|
||||
else
|
||||
logger -p "err" -t "adblock-notify-[${mail_ver}]" "msmtp mail daemon not found"
|
||||
fi
|
||||
|
||||
exit ${mail_rc}
|
||||
|
||||
Reference in New Issue
Block a user