#!/bin/sh
tclShell=/opt/tarantella/tools/ttatcl.sh
dirTools=/opt/tarantella/tools/tcls

dumpCMD=ttaDumpDs.tcl
restoreCMD=ttaRestoreDS.tcl
workDir=`pwd`;
dataStore="tta.DataStore"

[ $1 ] && $dataStore=$1;
[ $2 ] && $workDir=$2;

if [ -s $dataStore ] 
then 
     cd $workDir
     $tclShell $dirTools/$restoreCMD $dataStore
     [ "$?" -eq 0 ] &&  {
            cat tta.orgUnits | /opt/tarantella/bin/tarantella object script
            cat tta.containers | /opt/tarantella/bin/tarantella object script
            cat tta.persons | /opt/tarantella/bin/tarantella object script
            cat tta.server | /opt/tarantella/bin/tarantella object script
            cat tta.applications | /opt/tarantella/bin/tarantella object script
            cat tta.group | /opt/tarantella/bin/tarantella object script
            cat tta.link | /opt/tarantella/bin/tarantella object script
     }
else
     echo "No file: $dataStore "
fi
