#!/bin/sh
# STTA Rev. 1.3 Copyright (c) 2001-2004 Jess Prez Lorenzo  --- license GNU GPL
# stta: (@#) 1.31051043346- [2004_01_29_102036]

if [ -z "$STTA_TOOLSDIR" ] ; then 
    STTA_TOOLSDIR="/opt/tarantella/tools"
fi

dn=/dev/null				   ; export dn
tclShell=$STTA_TOOLSDIR/ttatcl             ; export tclShell
TTAdumpCMD=ttaDumpDs.tcl		   ; export TTAdumpCMD
TTArestoreCMD=ttaRestoreDs.tcl		   ; export TTArestoreCMD
OpenLDAP_cat="slapcat"			   ; export OpenLDAP_cat
OpenLDAP_add="slapadd"			   ; export OpenLDAP_add
OpenLDAP_slapd="slapd"			   ; export OpenLDAP_slapd

N=""
C=""
if echo -n | grep n > /dev/null
then
  C="\c"
else
  N="-n"
fi
case `uname -a` in
*inux*) N="$N -e" ;;
esac
export N C

[ -x "$STTA_TOOLSDIR/envstta" ] &&  . $STTA_TOOLSDIR/envstta

[ ! -d "$TTAINSTDIR" ] && echo "TTAINSTDIR environment not set. Run STTA config !!! " && exit 2

if [ -d $WEBMIN_ROOT/stta ] ; then 
   STTA="$WEBMIN_ROOT/stta"   ; export STTA
fi
if [ -d $STTA_TOOLSDIR/lang ] ; then 
   [ ! -r "$STTA_TOOLSDIR/lang/shells/$WEBMIN_LANG" ] && {
        if [ -z "$defaultLang" ] ; then
             defaultLang=`cat $WEBMIN_ETC/config 2>$dn | egrep "^lang=" | sed 's/lang=//g'`
        fi
        WEBMIN_LANG=$defaultLang
   }
   [ -r "$STTA_TOOLSDIR/lang/shells/$WEBMIN_LANG" ] &&  {
        . $STTA_TOOLSDIR/lang/shells/$WEBMIN_LANG 
   }
fi

TTABINDIR=$TTAINSTDIR/bin                  ; export TTABINDIR
TTACMD=$TTABINDIR/tarantella               ; export TTACMD
TTA_OBJSCRIPT_CMD=$TTACMD" object script"  ; export TTA_OBJSCRIPT_CMD
TTA_START="$TTACMD start"		   ; export TTA_START
TTA_STOP="$TTACMD stop"		  	   ; export TTA_STOP
TTA_ForceSTOP="$TTACMD stop --force"  	   ; export TTA_ForceSTOP
[ -z "$LDAP_log" ] && LDAP_log=$dn && export LDAP_log
[ -z "$LDAP_acclog" ] && LDAP_acclog=$dn && export LDAP_acclog
[ -z "$LDAPCACHE_log" ] && LDAPCACHE_log=$dn && export LDAPCACHE_log
[ -z "$LDAPCACHE_acclog" ]  && LDAPCACHE_acclog=$dn && export LDAPCACHE_acclog

[ -x "$STTA_TOOLSDIR/localenv_vars" ] &&  . $STTA_TOOLSDIR/localenv_vars
