]>
Commit | Line | Data |
---|---|---|
fc2e0831 | 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 | ||
f4f32185 | 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 | ||
fc2e0831 | 15 | # The following exit codes are defined and MUST BE CONSISTENT with the |
59ec8dae | 16 | # error codes the library uses: |
fc2e0831 | 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 | ||
dfaa6ee5 | 34 | chmod 640 username_id.* |
fc2e0831 | 35 | |
36 | rm -f $0 | |
37 | echo removed self | |
38 | ||
39 | exit 0 |