]> andersk Git - moira.git/blame - gen/stellar.sh
Care about public and hidden bits; look for MACHINE members of lists.
[moira.git] / gen / stellar.sh
CommitLineData
1964ff67 1#!/bin/sh
2#
3# $Header$
4
5PATH=/usr/bin:/bin:/usr/sbin:/sbin
6
7if [ -d /var/athena ] && [ -w /var/athena ]; then
8 exec >/var/athena/moira_update.log 2>&1
9else
10 exec >/tmp/moira_update.log 2>&1
11fi
12
13# The following exit codes are defined and MUST BE CONSISTENT with the
14# error codes the library uses:
15MR_MISSINGFILE=47836473
16MR_MKCRED=47836474
17MR_TARERR=47836476
18
19TARFILE=/var/tmp/stellar.out
20SRCDIR=/var/tmp/stellar.dir
21
22uchost=`hostname | tr '[a-z]' '[A-Z]'`
23echo $uchost | egrep -e "\." >/dev/null
24if [ $? != 0 ]; then
25 uchost=$uchost.MIT.EDU
26fi
27
28# Alert if the tar file does not exist
29test -r $TARFILE || exit $MR_MISSINGFILE
30
31# Make a temporary directory to unpack the tar file into
32rm -rf $SRCDIR
33mkdir $SRCDIR || exit $MR_MKCRED
34cd $SRCDIR || exit $MR_MKCRED
35
36# Extract everything
37tar xpf $TARFILE || exit $MR_TARERR
38
39if [ -f "$uchost" ]; then
40 /var/local/stellar-support/moira-to-stellar.perl
41else
42 exit $MR_MISSINGFILE
43fi
44
45# cleanup
46cd /
47rm -rf $SRCDIR
48test -f $TARFILE && rm -f $TARFILE
49test -f $0 && rm -f $0
50
51exit 0
This page took 0.059797 seconds and 5 git commands to generate.