X-Git-Url: http://andersk.mit.edu/gitweb/moira.git/blobdiff_plain/a428372f6574f90270fb54c640d281d5479c50db..efd55ca6a0af254936ef83080bb1c4f9883663a5:/gen/boot.sh diff --git a/gen/boot.sh b/gen/boot.sh index 41e12c77..5ded8df1 100755 --- a/gen/boot.sh +++ b/gen/boot.sh @@ -1,13 +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 MR_MKCRED=47836474 MR_TARERR=47836476 -PATH=... +PATH=/usr/bin TARFILE=/var/tmp/boot.out BOOTGEN=/var/boot/bootptab.print BOOTLOCAL=/var/boot/bootptab.local @@ -19,14 +25,11 @@ test -r $TARFILE || exit $MR_MISSINGFILE test -r $BOOTLOCAL || exit $MR_MISSINGFILE test -r $PSWDFILE || exit $MR_MISSINGFILE -# Unpack the tar file, getting only files that are newer than the -# on-disk copies (-u). When extracting files under /var/boot/hp, -# tack on a .new so we can recognize them in the next step cd / -pax -ru -s '|/var/boot/hp/.*$/&.new/' -f $TARFILE || exit $MR_TARERR +tar xf $TARFILE || exit $MR_TARERR # Append passwords, etc., to the new files -for f in find /var/boot/hp -name \*.new -print; do +for f in `find /var/boot/hp -name \*.new -print`; do cat $PSWDFILE >> $f mv $f /var/boot/hp/`basename $f .new` done @@ -34,11 +37,6 @@ done # Build full bootptab cat $BOOTLOCAL $BOOTGEN > $BOOTFILE -# Signal bootpd? XXX - -# Remove out-of-date hp files -find /var/boot/hp -mtime +1 -exec rm -f {} \; - # cleanup test -f $TARFILE && rm -f $TARFILE test -f $0 && rm -f $0