* preserve DNS cache after adblock processing, - 'unbound' and 'named' support this (please check readme) - 'dnsmasq' now uses the 'servers-file' directive to minimize the reload disruption, even though the dns cache will be cleared after SIGHUP - 'kresd' dns cache is persistent by upstream default, anyway Turris Omnia devices need a small upstream software change which is not accepted/implemented yet * email notification in case of an error or domain count < n (default 0, check readme) * removed securemecca from default config (service has been closed) * new separate functions for hash compare and list/overall count * add missing package dependencies * various clean-ups * update documentation Signed-off-by: Dirk Brenken <dev@brenken.org>
38 lines
1.2 KiB
Bash
38 lines
1.2 KiB
Bash
#!/bin/sh
|
|
#
|
|
# adblock send mail script for mstmp
|
|
# written by Dirk Brenken (dev@brenken.org)
|
|
# Please note: you have to install and configure the package 'mstmp' before using this script.
|
|
|
|
# This is free software, licensed under the GNU General Public License v3.
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
LC_ALL=C
|
|
PATH="/usr/sbin:/usr/bin:/sbin:/bin"
|
|
mail_daemon="$(command -v sendmail)"
|
|
mail_profile="adb_notify"
|
|
mail_debug="--debug"
|
|
mail_rc=0
|
|
|
|
# mail header
|
|
#
|
|
mail_sender="no-reply@adblock"
|
|
mail_receiver="!!!ChangeMe!!!"
|
|
mail_topic="adblock notification"
|
|
mail_head="From: ${mail_sender}\nTo: ${mail_receiver}\nSubject: ${mail_topic}\nReply-to: ${mail_sender}\n\n"
|
|
|
|
# mail body
|
|
#
|
|
mail_text="adblock status, generated at $(date 2>&1)!"
|
|
mail_text="${mail_text}\n++\n++ System Information ++\n++\n$(cat /etc/banner 2>&1)"
|
|
mail_text="${mail_text}\n\n++\n++ Adblock Information ++\n++\n$(/etc/init.d/adblock status 2>&1)"
|
|
|
|
# send mail
|
|
#
|
|
if [ -x "${mail_daemon}" ]
|
|
then
|
|
printf "%b" "${mail_head}${mail_text}" | "${mail_daemon}" ${mail_debug} -a "${mail_profile}" "${mail_receiver}" 2>&1
|
|
mail_rc=${?}
|
|
fi
|
|
exit ${mail_rc}
|