Former-commit-id:a02aeb236c
[formerly9f19e3f712
] [formerlya02aeb236c
[formerly9f19e3f712
] [formerly06a8b51d6d
[formerly 64fa9254b946eae7e61bbc3f513b7c3696c4f54f]]] Former-commit-id:06a8b51d6d
Former-commit-id:8e80217e59
[formerly3360eb6c5f
] Former-commit-id:377dcd10b9
51 lines
No EOL
1.3 KiB
Bash
51 lines
No EOL
1.3 KiB
Bash
#!/bin/ksh
|
|
# file name: process_hydro_model_data
|
|
# Created: 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
|
|
|
|
FILENAME=$1
|
|
SUBJECT=$2
|
|
MSGTYPE=$3
|
|
|
|
# use a shell function to extract the argument from the subject line
|
|
# the subject string is a quoted string with the a descriptive term,
|
|
# followed by a space, followed by the product identifier.
|
|
#
|
|
parseSubject()
|
|
{
|
|
ORIGINAL_FILE_NAME=$1
|
|
PRODUCTID=$2
|
|
return
|
|
}
|
|
#
|
|
# get the product id from the subject
|
|
#
|
|
parseSubject $SUBJECT
|
|
|
|
ORIGINAL_FILE_PATH=$SSHP_INCOMING_DIR/$ORIGINAL_FILE_NAME
|
|
|
|
# Keeps the last 1200 lines of the log file
|
|
|
|
LOGFILE=$SSHP_LOG_DIR/process_hydro_model_data.log
|
|
TMPFILE=$SSHP_LOG_DIR/process_hydro_model_data.tmp
|
|
|
|
tail -1200 $LOGFILE > $TMPFILE
|
|
mv $TMPFILE $LOGFILE
|
|
|
|
cp -f $FILENAME $ORIGINAL_FILE_PATH
|
|
|
|
# used to remove the header and ^Ms from the transferred XML file
|
|
sed '1,2d' $ORIGINAL_FILE_PATH > $SSHP_INCOMING_DIR/temp.xml
|
|
cat $SSHP_INCOMING_DIR/temp.xml | tr -d '\015' > $ORIGINAL_FILE_PATH
|
|
rm -f $SSHP_INCOMING_DIR/temp.xml
|
|
|
|
ssh -oBatchMode=yes $SSHP_JAVA_PROCESS_HOST $WHFS_BIN_DIR/run_SSHP_data_decode >$LOGFILE 2>>$LOGFILE |