mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-21 13:54:26 -07:00
refactoring: log_event(), is_format_valid()
This commit is contained in:
parent
325ca65f32
commit
a61a6e979e
52 changed files with 582 additions and 1170 deletions
|
@ -19,15 +19,13 @@ send_email_report() {
|
|||
else
|
||||
dns_conf='/etc/bind/named.conf'
|
||||
fi
|
||||
|
||||
send_mail="$VESTA/web/inc/mail-wrapper.php"
|
||||
email=$(grep CONTACT $VESTA/data/users/admin/user.conf)
|
||||
email=$(echo "$email" | cut -f 2 -d "'")
|
||||
tmpfile=$(mktemp)
|
||||
subj="$(hostname): $DNS_SYSTEM restart failed"
|
||||
/usr/sbin/named-checkconf $dns_conf >> $tmpfile 2>&1
|
||||
service $DNS_SYSTEM restart >> $tmpfile 2>&1
|
||||
cat $tmpfile | $send_mail -s "$subj" $email
|
||||
cat $tmpfile |$SENDMAIL -s "$subj" $email
|
||||
rm -f $tmpfile
|
||||
}
|
||||
|
||||
|
@ -56,8 +54,7 @@ if [ $? -ne 0 ]; then
|
|||
service $DNS_SYSTEM restart >/dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
send_email_report
|
||||
echo "Error: $DNS_SYSTEM restart failed"
|
||||
exit $E_RESTART
|
||||
check_result $E_RESTART "$DNS_SYSTEM restart failed"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue