With respect to teh secondary or 3rd name servers...
Because apache could stop working or go down, the script would then generate an empty file, or bind not restarting due to syntax error, i do it this way...
Keep in mind i am not a programing guy in any way..
The QazwsxedC.php file is that php file that generates the secondary stuff, i just double check everything after that......
#!/bin/bash
### Actually generate the secondary entries in a file and remove unwanted lines
ssh xx.xx.xx.149 sudo -u vu2000 php4-cgi -f /var/www/ispcp/gui/admin/dido/QazwsxedC.php |grep -v "<" >/var/tmp/named.secondary.tmp
### Simply replace a string that would cause bind to break
perl -pi -e 's/server Server Joe/#server Server Joe/g' /var/tmp/named.secondary.tmp
### Checking the secondary file to make sure it is OK as per BIND
BIND_syntax_test=$(/usr/sbin/named-checkconf /var/tmp/named.secondary.tmp &>/dev/null)$?
if [ $BIND_syntax_test -gt 0 ]
then
echo " *** There is something wrong with the named.secondary.tmp conf file on DNS2, located in /var/tmp OR it does not exist! Keeping existing file*** "
echo "Named.secondary zone file problem on DNS2, SYNTAX Error!" | mail rob@domain.ca -s "DNS2 **** Syntax error in named.secondary.tmp file on DNS2 ****"
# echo $BIND_syntax_test
exit
else
if [ -s /var/tmp/named.secondary.tmp ]
then
echo " The named.secondary.tmp file is OK"
cp /var/tmp/named.secondary.tmp /etc/bind/named.secondary
BIND_error_status=$(/etc/init.d/bind9 force-reload &>/dev/null)$?
else
echo "Named.secondary.tmp file problem on DNS2, its ZERO SIZE!" | mail rob@domain.ca -s "DNS2 **** Named.secondary.tmp zone file problem ****"
fi
fi
BIND_dido_test=$(grep "dido.ca" /var/tmp/named.secondary.tmp &>/dev/null)$?
if [ $BIND_dido_test -gt 0 ]
then
echo "Dido Zone file problem on DNS2, its not there!" | mail rob@domain.ca -s "DNS2 **** Dido zone file problem ****"
fi
# Just for testing below
#echo "Bind Error status--> $BIND_error_status"
#echo "Bind Syntax status --> $BIND_syntax_test"
#echo "Bind Dido status --> $BIND_dido_test"
HSorgYves Wrote:Check http://www.isp-control.net/documentation...nameserver