#!/bin/bash # a shell script to start the various DiFX CalcServers myhostname=`hostname` # DiFX_Delay_Server should come last in the following list, as # it will make RPC calls to the other servers serverlist="CalcServer CALC_9_1_RA_Server DiFX_Delay_Server" errors_found=0 echo "reset environment variables for CALCServer" export CALC_USER=C export WET_ATM=Y export JPLEPH=@prefix@/share/CalcServer/JPLEPH export SERVERLOG=ON export HORIZONS_FILENAME=@prefix@/share/CalcServer/Horizons.lis export HORIZONS_SRCNAME=TSTCURVE pushd /tmp for server in $serverlist do echo -e "\n\nterminating the ${server} that is currently running on ${myhostname}" killall "${server}" sleep 1 echo "starting new ${server} on ${myhostname}" if [ "$#" -ne 0 ] ; then @prefix@/bin/"${server}" >| "$1"."${server}" 2>&1 & else @prefix@/bin/"${server}" > /dev/null 2>&1 & fi echo "checking that the ${server} responds" sleep 1 echo " " @prefix@/bin/check"${server}" "${myhostname}" if test $? -ne 0 ; then echo >&2 "${server} is not working properly" errors_found=$(($errors_found + 1)) fi done if test $errors_found -ne 0 ; then echo >&2 "$errors_found servers failed to start properly" fi popd