1
0
Fork 0
knowledge-base/KB/Linux/Server/unbound/scripts/unbound_update_root_hints

24 lines
544 B
Text
Raw Normal View History

2022-09-04 12:54:22 +00:00
#!/bin/bash
hostname=$(hostname)
mail_from="monitoring@myservermanager.com";
mail_to="monitoring@myservermanager.com";
mail_enabled="true"
# action
wget ftp://FTP.INTERNIC.NET/domain/named.cache -O /etc/unbound/root.hints;
res=$?;
if [ $mail_enabled == 'true' ]; then
resText="Successfully updated";
if [ $res != 0 ]; then
resText="Failed to update"
fi
SUBJECT="[$hostname] ${resText} unbound root.hints";
CONTENTS="${resText} unbound root.hints.";
echo "${CONTENTS}" | mailx -Ssendwait -s "${SUBJECT}" $mail_to;
fi
exit $res;