awips2/edexOsgi/com.raytheon.uf.tools.gfesuite/cli/rsyncGridsToCWF_client.sh
Steve Harris 16bf591a33 12.7.1-8 baseline
Former-commit-id: 46767a18a0d6e1f2182720c8a04c6e1e59cb18a1
2012-07-19 16:20:40 -05:00

35 lines
1.5 KiB
Bash

#!/bin/sh
################################################################################
# #
# Program name: rsyncGridsToCWF_client.sh #
# #
# Executes rsynceGridsToCWF.sh locally or remotely as needed #
# #
# Author: Juliya Dynina #
# #
# Revisions: #
# 04/25/12: Created Script #
################################################################################
if [ $# -lt 1 ] ;then
echo Invalid number of arguments.
echo Script stopped.
echo ./rsyncGridsToCWF_client.sh wfo
exit
fi
host_name=`hostname`
host_name=`echo $host_name | cut -c1-3`
if [ $host_name != "dx3" ] && [ $host_name != "dx4" ]; then
CHK=`ssh -q -o "BatchMode yes" -o "ConnectTimeout 5" dx3 "echo success"`;
if [ "success" = $CHK ] >/dev/null 2>&1
then
echo "dx3 connection success - running on dx3"
ssh dx3 "/awips2/GFESuite/bin/rsyncGridsToCWF.sh ${1}"
else
echo "dx3 connection failure - running on dx4"
ssh dx4 "/awips2/GFESuite/bin/rsyncGridsToCWF.sh ${1}"
fi
else
/awips2/GFESuite/bin/rsyncGridsToCWF.sh ${1}
fi