#!/bin/sh

debug=1;

sh /home/dns_generator/run.sh clean
sh /home/dns_generator/run.sh gendns
sh /home/dns_generator/run.sh validate
if [ $? = 0 ]; then
  if [ $debug = 0 ]; then
    cp /home/dns_generator/*.in-addr.arpa /home/dns/master
    cp /home/dns_generator/*.NET /home/dns/master
    rndc reload
  fi
else
  if [ $debug = 1 ]; then
    echo "CONFIG ERRORS"
  fi
fi
