forked from menandmice-services/dns-monitoring-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test13.sh
executable file
·32 lines (27 loc) · 854 Bytes
/
test13.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh
# Test 13 - DS Records - test the number and the content of the DS
# records in the parent zone. Issue a warning when the count or the
# content changes
echo " == #13 - DS Records == "
if [ -f "$0.$1.saved.dscontent" ]; then
oldds=$(cat $0.$1.saved.dscontent)
olddscount=$(cat $0.$1.saved.dscount)
else
echo "First run. This result won't be meaningful until the next run.";
fi
ds=$(dig ${1} ds +short)
echo "${ds}" > $0.$1.saved.dscontent
dscount=$(dig ${1} ds +short | wc -l)
echo "${dscount}" > $0.$1.saved.dscount
if [ "${ds}" != "${oldds}" ]
then
echo "Warning: DS-Record has changed!"
else
echo "OK: DS-Record is the same as last time tested!"
fi
if [ "${dscount}" != "${olddscount}" ]
then
echo "Warning: number of DS-Record has changed!"
else
echo "OK: number of DS-Record is the same as last time tested!"
fi