#!/bin/sh
# STTA Rev. 1.3 Copyright (c) 2001-2003 Jess Prez Lorenzo  --- license GNU GPL 
# stta: (@#) 1.3pre1049295437- [2003_4_02_165717]
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"

case "$#" in
 0|1) echo "$0 [ file-data-Store ] [ existing-working-directory] " ; exit ;;
esac

[ $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
