Skip to content

Commit 976e583

Browse files
committed
named-checkconf validation output
1 parent cad5397 commit 976e583

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

bin/v-restart-dns

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,14 @@ if [ ! -z "$DNS_SYSTEM" ]; then
4343
email=$(echo "$email" | cut -f 2 -d "'")
4444
tmpfile=$(mktemp)
4545
subj="$(hostname): $DNS_SYSTEM restart failed"
46-
/etc/init.d/$DNS_SYSTEM configtest >> $tmpfile 2>&1
46+
47+
# Get dns config path
48+
if [ -e '/etc/named.conf' ]; then
49+
dns_conf='/etc/named.conf'
50+
else
51+
dns_conf='/etc/bind/named.conf'
52+
fi
53+
named-checkconf $dns_conf >> $tmpfile 2>&1
4754
/etc/init.d/$DNS_SYSTEM restart >> $tmpfile 2>&1
4855
cat $tmpfile | $send_mail -s "$subj" $email
4956
rm -f $tmpfile

0 commit comments

Comments
 (0)