]> andersk Git - moira.git/blobdiff - gen/warehouse.sh
Command line printer manipulation client, and build goo.
[moira.git] / gen / warehouse.sh
index a6475ce47ce8b8ef9bbbc2f0e0b2bc38be941a5c..0bb6e416543ac528f94619f5b61c2aeab5cf5bb2 100644 (file)
@@ -1,33 +1,28 @@
 #!/bin/sh
-#
-#
-DIR=/warehouse/transfers/moirausr
-TAR_FILE=$DIR/moira.tar.Z
+# $Id$
 
-PATH="/etc:/bin:/usr/bin:/usr/etc:/usr/athena/etc"
+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:
-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
This page took 0.040138 seconds and 4 git commands to generate.