40 lines
1.1 KiB
Text
40 lines
1.1 KiB
Text
|
#!/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
|