forked from critical/dns-zones
Add import_zone script from NS2
Signed-off-by: Jan Dittberner <jandd@cacert.org>
This commit is contained in:
parent
143cc348cb
commit
1b231b8fb5
1 changed files with 21 additions and 0 deletions
21
import_zone
Normal file
21
import_zone
Normal file
|
@ -0,0 +1,21 @@
|
|||
set -x
|
||||
domain=$1
|
||||
now=$(date +"%Y%m%d_%H%M%S")
|
||||
pdnsutil list-zone $1 > $1.$now
|
||||
grep -v SOA $1 >$1.new
|
||||
grep SOA $1.$now >> $1.new
|
||||
pdnsutil load-zone $1 $1.new
|
||||
pdnsutil increase-serial $1
|
||||
mysqldump powerdns > powerdns.dump.$now
|
||||
|
||||
echo "From: Nameserver NS2 <root@ns2.cacert.org>" > mail.txt
|
||||
echo "To: critical-admin@cacert.org" >> mail.txt
|
||||
echo "Subject: Update of zone $1" >> mail.txt
|
||||
#echo "$1 has now the following zonefile-data:" >>mail.txt
|
||||
pdnsutil list-zone $1 > $1.now
|
||||
echo >>mail.txt
|
||||
diff -u0 -b $1.$now $1.now >>mail.txt
|
||||
echo " ------------------------- " >> mail.txt
|
||||
pdnsutil list-zone $1 >> mail.txt
|
||||
|
||||
cat mail.txt | ssmtp -6 critical-admin@cacert.org
|
Loading…
Reference in a new issue