X-Git-Url: http://andersk.mit.edu/gitweb/moira.git/blobdiff_plain/abb00e7a48e50a7d149715b4ddd47c9206a70f56..47566befc18ff8e25b58caffef0459f9e411f177:/gen/sapprint.sh diff --git a/gen/sapprint.sh b/gen/sapprint.sh index 5605ef62..6fdf353b 100755 --- a/gen/sapprint.sh +++ b/gen/sapprint.sh @@ -1,12 +1,19 @@ #! /bin/sh # $Id$ +if [ -d /var/athena ] && [ -w /var/athena ]; then + exec >/var/athena/moira_update.log 2>&1 +else + exec >/tmp/moira_update.log 2>&1 +fi + # The following exit codes are defined and MUST BE CONSISTENT with the # error codes the library uses: MR_MISSINGFILE=47836473 PATH=/bin -OUTFILE=/var/tmp/sapprint.out +OUTFILE=/var/tmp/sapprint.out.moira +DSTFILE=/var/tmp/sapprint.out # Alert if the output file doesn't exist test -r $OUTFILE || exit $MR_MISSINGFILE @@ -16,6 +23,9 @@ chown root $OUTFILE chgrp 0 $OUTFILE chmod 644 $OUTFILE +# mv file into place. +mv $OUTFILE $DSTFILE + # cleanup test -f $0 && rm -f $0