Created
May 24, 2012 22:17
-
-
Save dogsbody/2784525 to your computer and use it in GitHub Desktop.
Create a file from BlueOnyx of all the primary domains hosted to push to a secondary
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
############################################################################## | |
# # | |
# Pushes all the domains to the secondary servers # | |
# Version 1.20 # | |
# Lasted Edited on 24 May 2012 # | |
# Contact Dan Benton at [email protected] # | |
# Or visit me at http://www.dogsbodytechnology.com/ # | |
# # | |
# Creates the correct file to push to a secondary provider # | |
# # | |
############################################################################## | |
# EDIT BETWEEN HERE # | |
############################################################ | |
SECFILE=/etc/named/zones.secdns | |
OLDSECFILE=/etc/named/zones.secdns.old | |
NCFTPDATA=/root/.ncftp | |
############################################################ | |
# AND HERE # | |
############################################################ | |
mv $SECFILE $OLDSECFILE | |
cat /dev/null > $SECFILE | |
IPADDRESS=`/sbin/ifconfig eth0 | grep "inet addr" | awk -F: '{print $2}' | awk '{print $1}'` | |
for DOM in $(ls -A1 /etc/named | grep "^db\." | grep -v "\.include$\|\~$" | sed s~^db.~~ | sort -d) | |
do echo $DOM:$IPADDRESS | |
done >> $SECFILE | |
if ! diff $OLDSECFILE $SECFILE ; then | |
echo "Uploading to Secondary" | |
ncftpput -a -f $NCFTPDATA ./ $SECFILE | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment