You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by jm...@apache.org on 2007/08/13 14:26:02 UTC

svn commit: r565324 - /spamassassin/trunk/build/mkupdates/tick_zone_serial

Author: jm
Date: Mon Aug 13 05:26:01 2007
New Revision: 565324

URL: http://svn.apache.org/viewvc?view=rev&rev=565324
Log:
allow the SOA file to be specified on command line; reload just the changed zone

Modified:
    spamassassin/trunk/build/mkupdates/tick_zone_serial

Modified: spamassassin/trunk/build/mkupdates/tick_zone_serial
URL: http://svn.apache.org/viewvc/spamassassin/trunk/build/mkupdates/tick_zone_serial?view=diff&rev=565324&r1=565323&r2=565324
==============================================================================
--- spamassassin/trunk/build/mkupdates/tick_zone_serial (original)
+++ spamassassin/trunk/build/mkupdates/tick_zone_serial Mon Aug 13 05:26:01 2007
@@ -10,7 +10,7 @@
 
 set -x
 
-cd /home/updatesd/svn/spamassassin
+[ -d /home/updatesd/svn/spamassassin ] && cd /home/updatesd/svn/spamassassin
 
 
 . /etc/profile
@@ -22,6 +22,9 @@
 # it must be writable by the user this script runs as.
 #
 soadir=/var/named/spamassassin.org.d
+if [ "$#" -gt 0 ]; then
+  soadir="$1"
+fi
 
 # ---------------------------------------------------------------------------
 
@@ -52,6 +55,7 @@
 rm -f $soafile.bak \
       $soafile.new
 
+touch $soafile # this must exist
 if sed -e 's/__SERIAL__/'"$newserial"'/' \
 	< $soafile.tmpl > $soafile.new && \
     [ -s $soafile.new ] && \
@@ -66,6 +70,7 @@
 
 
 # trigger a named reload of that changed zone
-sudo rndc reload  || exit $?
+zone=`perl -e '$_=join("", <STDIN>); /^\s*(\S+)/ and print $1' < $soafile`
+sudo rndc reload $zone || exit $?
 
 exit 0