#!/bin/sh
# STTA Rev. 1.3 Copyright (c) 2001-2004 Jesús Pérez Lorenzo  --- license GNU GPL 
# stta: (@#) 1.31051043346- [2004_01_29_102036]

dataDir=`pwd`;
ensBak="ens.cpio.gz"
[ $1 ] && dataDir=$1;

STTA_TOOLSDIR="STTATOOLSDIR"
[ -x $STTA_TOOLSDIR/setenv_vars ] &&  . $STTA_TOOLSDIR/setenv_vars
TTAHOME=$TTAINSTDIR

if [ -s $dataDir/$ensBak ] 
then 
     cp $dataDir/$ensBak $TTAHOME/var
     cd $TTAHOME/var
     $UnZipTool $ensBak
     if [ "$?" -eq 0 ] ; then 
          ensfile=`echo $ensBak| sed 's/.gz//'`
          $TTA_ForceSTOP
          rm -r ens.old 2>$dn
          echo $msg_ensrenamed
          mv ens ens.old 
          $extract_cmd $ensfile
          [ "$?" -ne 0 ] && rm -r ens &&  mv ens.old ens  && echo $msg_errorens
          rm $ensfile 2>$dn
          $TTA_START
     fi
else
     echo "$msg_noensfile"
fi
