Multiple changes for RHEL 7support

This commit is contained in:
Serghey Rodin 2014-12-17 02:12:55 +02:00
commit b978e72977
8 changed files with 50 additions and 53 deletions

View file

@ -26,7 +26,7 @@ send_email_report() {
tmpfile=$(mktemp)
subj="$(hostname): $DNS_SYSTEM restart failed"
named-checkconf $dns_conf >> $tmpfile 2>&1
/etc/init.d/$DNS_SYSTEM restart >> $tmpfile 2>&1
service $DNS_SYSTEM restart >> $tmpfile 2>&1
cat $tmpfile | $send_mail -s "$subj" $email
rm -f $tmpfile
}
@ -51,9 +51,9 @@ if [ -z "$DNS_SYSTEM" ] || [ "$DNS_SYSTEM" = 'remote' ] ; then
fi
# Restart system
/etc/init.d/$DNS_SYSTEM reload >/dev/null 2>&1
service $DNS_SYSTEM reload >/dev/null 2>&1
if [ $? -ne 0 ]; then
/etc/init.d/$DNS_SYSTEM restart >/dev/null 2>&1
service $DNS_SYSTEM restart >/dev/null 2>&1
if [ $? -ne 0 ]; then
send_email_report
echo "Error: $DNS_SYSTEM restart failed"