#!/bin/sh
-#
-#
-DIR=/warehouse/transfers/moirausr
-TAR_FILE=$DIR/moira.tar.Z
-
-PATH="/etc:/bin:/usr/bin:/usr/etc:/usr/athena/etc"
+# $Id$
if [ -d /var/athena ] && [ -w /var/athena ]; then
exec >/var/athena/moira_update.log 2>&1
# The following exit codes are defined and MUST BE CONSISTENT with the
# error codes the library uses:
-set MR_MISSINGFILE = 47836473
-set MR_TARERR = 47836476
-
-cd $DIR
-
-echo extracting $TAR_FILE
+MR_MISSINGFILE=47836473
-if [ ! -f $TAR_FILE ]; then
- exit $MR_MISSINGFILE
-fi
+PATH="/etc:/bin:/usr/bin:/usr/etc:/usr/athena/etc"
+OUTFILE=/warehouse/transfers/moirausr/username_id.map.txt
-if zcat < $TAR_FILE | tar xvf -; then
- echo Extract successful
-else
- exit $MR_TARERR
-fi
+# Alert if the output file doesn't exist
+test -r $OUTFILE || exit $MR_MISSINGFILE
-chmod 640 username_id.*
+# Set the perms usefully
+chown root $OUTFILE
+chgrp 0 $OUTFILE
+chmod 644 $OUTFILE
-rm -f $0
-echo removed self
+# cleanup
+test -f $0 && rm -f $0
exit 0