7 # ------------------------------------------------------------------------------------------ 
    9 #                             Utility script to run JLigier. 
   11 # ------------------------------------------------------------------------------------------ 
   13 if [ -z $JPP_DIR ]; 
then 
   14     echo "Variable JPP_DIR undefined." 
   18 source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/
null 
   26 if ( do_usage $* ); 
then 
   27     print -u2 
"$script <option>" 
   28     print -u2 
"Possible options: start, stop, continue, restart." 
   39     fatal 
"Invalid option $OPTION."     
   42 if   [[ 
$OPTION == 
"stop" || $OPTION == 
"restart" ]]; 
then 
   44     PID=`get_pid $COMMAND`
 
   46     if [[ -
n $PID ]]; 
then  
   47         notice 
"Stop $COMMAND on $HOST with PID $PID." 
   51     OPTION=${OPTION/restart/start}
 
   53 elif [[ $OPTION == 
"continue" ]]; 
then 
   55     PID=`get_pid $COMMAND`
 
   57     if [[ -
n $PID ]]; 
then  
   58         notice 
"JLigier is running on $HOST with PID $PID." 
   65 if [[ $OPTION = 
"start" ]]; 
then 
   67     notice 
"Start $COMMAND on $HOST." 
   68     nohup $COMMAND -
P $PORT -
T $TIMEOUT -
d $DEBUG --! >& 
$WORKDIR/ligier.log &
 
   72     PID=`get_pid $COMMAND`
 
   73     if [[ -
n $PID ]]; 
then  
   74         notice 
"JLigier is running on $HOST with PID $PID." 
   76         error  
"JLigier is not running on $HOST." 
void set_variable(const std::string &name, const std::string &value)
Set environment variable. 
 
do set_variable OUTPUT_DIRECTORY $WORKDIR T
 
then JMuonMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
 
alias put_queue eval echo n
 
then usage $script< detector >< run >< outputfile > fi case set_variable OPTION
 
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
 
*fatal Wrong option $OPTION
 
then usage $script< detector file >< inputfile > fi case set_variable WORKDIR
 
esac $JPP_BIN JLogger sh $LOGGER until pgrep JGetMessage</dev/null > dev null
 
#define DEBUG(A)
Message macros.