runRequest 777 Bytes
#!/bin/bash
# Prepare & Run Request

tgt_vi=$1
src_vi=$2
TaoStop=$3
SwStop=$4

. $(dirname $BASH_SOURCE)/env.sh

 IFS='_' read -r -a array <<< "$tgt_vi"
 tgt=${array[0]}
 
 IFS='_' read -r -a array <<< "$src_vi"
 src=${array[0]}
 
 # delete results of previous calculations
 rm -rf $SW2NC/$tgt* $SW2DATA/$src/$tgt*
 
 # delete previous requests 
 rm -f $REQ/*.xml 

 cd $SW2ROOT/Bin.py; python makeRequest.py  $tgt_vi $src_vi $TaoStop $SwStop  > log
 DDLogin $DDUSER $DDPWD >> log
  
	
 # run newly created Request - ONLY FIRST ONE !
 # can be launched as stand alone executable
 for request in $REQ/$tgt*.xml
  do
       if [[ -f $request ]]
       then
		python run.py $tgt $request $SwStop & echo $!
	else
	       echo -100
	fi 
	# run only first request !!!!
	exit
  done