]> andersk Git - moira.git/blob - gen/warehouse.sh
34ac4d99c5270287e7934c3509923cd090240d30
[moira.git] / gen / warehouse.sh
1 #!/bin/sh
2 #
3 #
4 DIR=/warehouse/transfers/moirausr
5 TAR_FILE=$DIR/moira.tar.Z
6
7 PATH="/etc:/bin:/usr/bin:/usr/etc:/usr/athena/etc"
8
9 if [ -d /var/athena ] && [ -w /var/athena ]; then
10     exec >/var/athena/moira_update.log 2>&1
11 else 
12     exec >/tmp/moira_update.log 2>&1
13 fi
14
15 # The following exit codes are defined and MUST BE CONSISTENT with the
16 # error codes the library uses:
17 set MR_MISSINGFILE =    47836473
18 set MR_TARERR =         47836476
19
20 cd $DIR
21
22 echo extracting $TAR_FILE
23
24 if [ ! -f $TAR_FILE ]; then
25         exit $MR_MISSINGFILE
26 fi
27
28 if zcat < $TAR_FILE | tar xvf -; then
29         echo Extract successful
30 else
31         exit $MR_TARERR
32 fi
33
34 chmod 640 username_id.*
35
36 rm -f $0
37 echo removed self
38
39 exit 0
This page took 0.125029 seconds and 3 git commands to generate.