#!/bin/ksh
#
arguments=$*

ici=${PWD} ; REPCFG=${PWD}
if [ $1 ] ; then
  cd $1 2> /dev/null
  if [ $? -eq 0 ] ; then
    REPCFG=${PWD}
  else
    printf "\n Directory $1 is unavailable --- ABORT ---\n\n"
    exit
  fi
  cd ${ici}
fi

# NOTES: Variables _job, _listing and _status
#        can be used as output from Um_lance_multi or
#        Um_lance_single. To use those variables simply
#        launch one of those scripts directly with ". r.call.dot"
#

if [ -s ${REPCFG}/BATCH_config.cfg ] ; then
  printf "\n Um_lance_multi $arguments\\n"
  . r.call.dot Um_lance_multi $arguments
else
  printf "\n Um_lance_single $arguments\n\n"
  . r.call.dot Um_lance_single $arguments
fi

printf "\n Um_lance STATUS: $_status\n\n"
