]> andersk Git - moira.git/blob - gen/winstats.sh
Remove tarfile once we're done.
[moira.git] / gen / winstats.sh
1 #!/bin/sh
2
3 dir=/var/ops/populate/stats
4 tarfile=/var/tmp/winstats.out
5
6 PATH="/etc:/bin:/usr/bin:/usr/etc:/usr/athena/etc"
7
8 if [ -d /var/athena ] && [ -w /var/athena ]; then
9     exec >/var/athena/moira_update.log 2>&1
10 else
11     exec >/tmp/moira_update.log 2>&1
12 fi
13
14 # The following exit codes are defined and MUST BE CONSISTENT with the
15 # error codes the library uses:
16 MR_MISSINGFILE=47836473
17 MR_TARERR=47836476
18
19 if [ ! -f $tarfile ]; then
20     exit $MR_MISSINGFILE
21 fi
22
23 cd $dir
24 tar xf $tarfile
25
26 if [ $? != 0 ]; then
27     exit $MR_TARERR;
28 fi
29
30 chmod 644 *
31
32 rm -f $tarfile
33 rm -f $0
34 exit 0
35
36
This page took 0.036279 seconds and 5 git commands to generate.