#!/bin/bash
# a shell script to start CalcServer

echo "terminate CALCServer that is currently running on" `hostname`
killall CalcServer

echo "reset environment variables for CALCServer"
export CALC_USER=C
export WET_ATM=Y
export JPLEPH=/mnt/gluster-input/code/difx/share/CalcServer/JPLEPH
export SERVERLOG=ON
export HORIZONS_FILENAME=/mnt/gluster-input/code/difx/share/CalcServer/Horizons.lis
export HORIZONS_SRCNAME=TSTCURVE

pushd /tmp

echo "starting new CalcServer on" `hostname`
/mnt/gluster-input/code/difx/bin/CalcServer > /dev/null &
echo "checking that the CalcServer responds"
sleep 1
echo "  "
/mnt/gluster-input/code/difx/bin/checkCalcServer `hostname` 

popd
