]> andersk Git - moira.git/blobdiff - gen/warehouse.sh
Command line printer manipulation client, and build goo.
[moira.git] / gen / warehouse.sh
index 34ac4d99c5270287e7934c3509923cd090240d30..0bb6e416543ac528f94619f5b61c2aeab5cf5bb2 100644 (file)
@@ -1,10 +1,5 @@
 #!/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
@@ -14,26 +9,20 @@ 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.033552 seconds and 4 git commands to generate.