Deployment script for SICS and instrument configuration files.

r1108 | ffr | 2006-09-07 12:46:42 +1000 (Thu, 07 Sep 2006) | 2 lines
This commit is contained in:
Ferdi Franceschini
2006-09-07 12:46:42 +10:00
committed by Douglas Clowes
parent e3c462aa66
commit b083fe94ee

View File

@@ -0,0 +1,78 @@
#!/bin/sh
# $Revision: 1.1 $
# $Date: 2006-09-07 02:46:42 $
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
# Last revision by $Author: ffr $
# Deploys SICServer and configuration files to
# an instrument control computer.
# It requires a MANIFEST.TXT file for each instrument
usage()
{
echo deploySICS.sh copies SICS and the files listed
echo in the MANIFEST.TXT files to the IC host.
echo -e "Usage:\t./deploySICS.sh INSTRUMENT";
echo -e "\twhere INSTRUMENT can be hrpd, echidna, hipd, wombat ...";
}
if [ $# -eq 0 ]
then
usage
fi
INSTRUMENT=$1
SRCDIR=./
DESTDIR=/usr/local/sics/server
# Set the destination host and the
# instrument src directory
case $INSTRUMENT in
hrpd|echidna)
DESTHOST=ic-echidna.nbi.ansto.gov.au
INSTSRC=hrpd;;
hipd|wombat)
DESTHOST=ic-wombat.nbi.ansto.gov.au
INSTSRC=hipd;;
qld|koala)
DESTHOST=ic-koala.nbi.ansto.gov.au
INSTSRC=qld;;
reflectometer|platypus)
DESTHOST=ic-platypus.nbi.ansto.gov.au
INSTSRC=reflectometer;;
rsd|kowari)
DESTHOST=ic-kowari.nbi.ansto.gov.au
INSTSRC=qld;;
sans|quokka)
DESTHOST=ic-quokka.nbi.ansto.gov.au
INSTSRC=sans;;
tas|taipan)
DESTHOST=ic-taipan.nbi.ansto.gov.au
INSTSRC=tas;;
esac
if [ ! -e $SRCDIR/MANIFEST.TXT ]
then
echo "$SRCDIR/MANIFEST.TXT not found"
exit 1
fi
if [ ! -e $INSTSRC/MANIFEST.TXT ]
then
echo "$INSTSRC/MANIFEST.TXT not found"
echo "You must list the files required for $INSTRUMENT in the manifest"
exit 1
fi
# Get list of files to copy
COMMON=$(for f in $(cat $SRCDIR/MANIFEST.TXT); do echo -n "$SRCDIR/$f "; done)
INSTSPEC=$(for f in $(cat $INSTSRC/MANIFEST.TXT); do echo -n "$INSTSRC/$f "; done)
# Create a manifest of the files installed on the IC host
echo "Date: $(date -Iminutes)" > /tmp/MANIFEST.TXT
echo -e "The following files were installed by $USER\n" >> /tmp/MANIFEST.TXT
cat $SRCDIR/MANIFEST.TXT $INSTSRC/MANIFEST.TXT >> /tmp/MANIFEST.TXT
scp ../SICServer $COMMON $INSTSPEC /tmp/MANIFEST.TXT $DESTHOST:$DESTDIR
rm /tmp/MANIFEST.TXT