#!/bin/bash DOMAINS=/tmp/dnsdomains.txt SUBNETS=/tmp/dnssubnets.txt CCE=/usr/sausalito/bin/cceclient MASTERIP=1.2.3.4 wget -q -O- http://$MASTERIP/dnsdomains.txt > $DOMAINS wget -q -O- http://$MASTERIP/dnssubnets.txt > $SUBNETS COUNT=`cat $DOMAINS | wc -l` if [ $COUNT -lt 1 ]; then echo Did not find domain list - Bailing fi /root/dnsDeleteAllRecords.pl --delete-confirm for X in `cat $DOMAINS` do echo CREATE DnsSlaveZone masters = \"$MASTERIP\" domain = \"$X\" | $CCE done for X in `cat $SUBNETS` do IP=`echo $X | cut -d ":" -f 1` NETMASK=`echo $X | cut -d ":" -f 2` echo CREATE DnsSlaveZone masters = \"$MASTERIP\" netmask = \"$NETMASK\" ipaddr = \"$IP\" | $CCE done