awips2/nativeLib/ohd.sshp/scripts/run_SSHP_data_send
root e2ecdcfe33 Initial revision of AWIPS2 11.9.0-7p5
Former-commit-id: a02aeb236c [formerly 9f19e3f712] [formerly a02aeb236c [formerly 9f19e3f712] [formerly 06a8b51d6d [formerly 64fa9254b946eae7e61bbc3f513b7c3696c4f54f]]]
Former-commit-id: 06a8b51d6d
Former-commit-id: 8e80217e59 [formerly 3360eb6c5f]
Former-commit-id: 377dcd10b9
2012-01-06 08:55:05 -06:00

39 lines
1.1 KiB
Bash

#!/bin/ksh
# file name: run_sshp_data_sender
# Purpose: this will contain the code to send a message over the AWIPS
# Message Handling System (MHS)
# For now, in order to test the overall system, though, it just does a copy
# Created: 03-05-2004
# Last Modified: 04-01-2004
# This allows you to run this script from outside of ./bin
RUN_FROM_DIR=`dirname $0`
# set up SOME environment variables for WHFS applications
. $RUN_FROM_DIR/../../set_hydro_env
# setup the AWIPS environment
#
. $FXA_HOME/readenv.sh
FILEPATH=$1
FILENAME=$2
MHS_SITE_ID=$3
PRODUCT_ID=$4
cp $FILEPATH SSHP_OUTGOING_DIR/.
# Keeps the last 1200 lines of the log file
LOGFILE=$SSHP_LOG_DIR/SshpDataSender.log
TMPFILE=$SSHP_LOG_DIR/SshpDataSender.tmp
tail -1200 $LOGFILE > $TMPFILE
mv $TMPFILE $LOGFILE
# Send product to specific location
# add the one-word description and the office id
#
echo "Sending file:$FILENAME product_ID:$PRODUCT_ID to $MHS_SITE_ID via distributeProduct" >> $LOGFILE
SUBJECT="$FILENAME $PRODUCT_ID Hydro_Model_Data"
/awips/fxa/bin/distributeProduct -c HYDRO_MODEL_DATA -s "$SUBJECT" -a $MHS_SITE_ID $PRODUCT_ID $FILEPATH