#! /usr/dt/bin/dtksh
#
# To load and run "v51ready" program from CD-ROM or DataVolume
# ("v5ready" check machine's readiness for loading Brisque version 5.1)
#
# By: David Engelman 14.09.05
#
Dir=`echo $0 | cut -c1`
if [ "$Dir" = "/" ]
then
  Dir=`dirname $0`
else
  Dir=`pwd`
  Dir=`echo $Dir"/"$0`
  Dir=`dirname $Dir`
fi

# MountDir=`mount | grep cd0 | awk '{print $2}'`
# if [ "$MountDir" = "/scidev/rmv/cd0" ]; then 

Env=`who am i | awk '{print $1}'`
if [ "$Env" = "cdesci" ]
then
  su sciroot -c "tar xvf $Dir/.v51tar"
  su sciroot -c "cp $Dir/.LABEL /tmp"
  cd /scitex/version/scripts
  aixterm -fn Rom17 -geometry 90x28+2+2 -T v5ready -e su sciroot -c "exec ./v51ready $1 $2 $3 $4 $5"
  # after the v5ready program ends
  clear
  echo "\n\n\t To close this window press: Alt+F4"
  echo "\n\t or select: Window  from the menu and then select: Close"
else
  tar xvf $Dir/.v51tar
  cp $Dir/.LABEL /tmp
  cd /scitex/version/scripts
  exec ./v51ready $1 $2 $3 $4 $5
fi

