#!/bin/sh
# STTA Rev. 1.3 Copyright (c) 2001-2002 Jesús Pérez Lorenzo  --- license GNU GPL 
tclShell=/opt/tarantella/tools/ttatcl
dirTools=/opt/tarantella/tools/tcls
ttacmd="/opt/tarantella/bin/tarantella object script"

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

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

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