#! /bin/bash
cyflexlogevent -t generic -m 1 -m "script" -m "$0" 

#
# Script name: cui master_specs_file
#
# Purpose: Bring up the CUI application.
#
# Notes:
# The command line argument is required and must be a master
#    specs file.
# A check is made to insure that /cell/cui_properties.txt file exists.
#
# History:
#    02/27/10 - Rob Janes - Updated to log messages to /data/errors
#    06/02/08 - Rob Janes - Updated to go through generic_java.
#    03/05/08 - Rob Janes - Initial release.
#

. configure_java

# The properties file must exist and be readable.
if [ ! -r $CELL/cui_properties.txt ]; then
   echo The file $CELL/cui_properties.txt does not exist.
   echo It must exist for you to be able to run CUI.
   echo See $GUI/xmlfiles/cui/demo/properties.txt for
   echo '   an example.'
   exit 7
fi

export PROPERTIES="-DPropertiesFile=$CELL/cui_properties.txt"
export CLASSPATH=$GUI/gp_test.jar

DATE=`date +"%y%m%d"`
date >>/data/errors/cui.log.$DATE
generic_java com.cybermetrix.cyflex.cui.CUI $* >>/data/errors/cui.log.$DATE 2>&1
