watchdog dnsmanagerd to powerdns: do not update invalid zones.
This commit is contained in:
parent
89e970f450
commit
bfcba42375
@ -4,6 +4,11 @@ export PATH=/bin:/sbin:/usr/bin:/usr/sbin
|
|||||||
# Copying files from the dnsmanagerd bind9 directory to the powerdns directory.
|
# Copying files from the dnsmanagerd bind9 directory to the powerdns directory.
|
||||||
PDNSDIR="/var/powerdns/"
|
PDNSDIR="/var/powerdns/"
|
||||||
DNSMANDIR="/tmp/DATA-dnsmanagerd/bind9-zones/"
|
DNSMANDIR="/tmp/DATA-dnsmanagerd/bind9-zones/"
|
||||||
|
LOGFILE="/tmp/invalid-domains"
|
||||||
|
|
||||||
|
test_domain_validity() {
|
||||||
|
named-checkzone $1 $DNSMANDIR/$1 1>/dev/null 2>/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
local_update() {
|
local_update() {
|
||||||
echo "update domain $1"
|
echo "update domain $1"
|
||||||
@ -19,8 +24,13 @@ action() {
|
|||||||
file=$2
|
file=$2
|
||||||
|
|
||||||
echo $event | grep "MOVED_TO" >/dev/null
|
echo $event | grep "MOVED_TO" >/dev/null
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
test_domain_validity $file
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
local_update $file
|
local_update $file
|
||||||
|
else
|
||||||
|
echo "invalid domain: $file" >> $LOGFILE
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo $event | grep "DELETE" >/dev/null
|
echo $event | grep "DELETE" >/dev/null
|
||||||
|
Loading…
Reference in New Issue
Block a user