79 lines
1.9 KiB
Bash
Executable File
79 lines
1.9 KiB
Bash
Executable File
#!/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
|