#!/bin/sh # # update-dns # John Simpson 2004-06-13 # # runs on a child nameserver # copies incoming data stream to tinydns "data" file # then runs "make" to build "data.cdb" file # keeps the 10 most recent files around for backup purposes # # 2007-08-18 jms1 - modifying for non-root slave user # # 2007-08-19 jms1 - adding call to run "./trigger-make" if it exists. # see http://qmail.jms1.net/djbdns/replication.shtml for details. # # 2007-09-11 jms1 - fixed typo in "trigger-make" calls # ############################################################################### # # Copyright (C) 2004,2007 John Simpson. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 or version 3 of the # license, at your option. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # ############################################################################### DATE=`date +%Y-%m-%d.%H%M%S` echo Writing incoming data to data.$DATE cat > data.$DATE echo Updating data file cat data.$DATE > data chmod 644 data if [ -e trigger-make ] then echo Pushing data to further slave servers ./trigger-make else echo Activating new data /usr/local/bin/tinydns-data chmod 644 data.cdb fi echo Cleaning up old files /usr/local/bin/delbut -10 data.2*