#!/bin/ksh
# -----------------------------------------------------------------------------
#
# ident  "@(#)catc version 1.1 31 Jul 1996 SMI"
#
# Copyright 01/10/97 Sun Microsystems, Inc. All Rights Reserved
#
# -----------------------------------------------------------------------------
#
# check DISPLAY veriable
if [ "$DISPLAY" = "" ] 
then
	echo "no \$DISPLAY environment variable"
	echo "cattool stopped"
	exit 1
fi
#
/usr/openwin/bin/xset -display $DISPLAY q 1>/dev/null 2>/dev/null
if [ $? != 0 ]
then
        echo "unable to open display \"$DISPLAY\""
        echo "cattool stopped"
	exit 1
fi
#
# default installation directory
#  
INSTALL_DIR=${CAT_INSTALL_DIR:=/opt/SUNWconn/AgtTester}  
export INSTALL_DIR

#
# default installation for tcl/tk
#
TCL_INSTALL_DIR=${TCL_HOME:=/opt/SUNWtcl}

#
# set and export Tcl env Variables
#
TCL_LIBRARY=$TCL_INSTALL_DIR/7.5/lib/tcl7.5
TK_LIBRARY=$TCL_INSTALL_DIR/7.5/lib/tk4.1
TIX_LIBRARY=$INSTALL_DIR/lib/tix4.0.4
TCLX_LIBRARY=$INSTALL_DIR/lib/tclX7.5.0

# export Tcl env Variables
#
export TCL_LIBRARY TK_LIBRARY TIX_LIBRARY TCLX_LIBRARY

#
# set path for USEFUL.mib
#
FBPATH=$FBPATH:$INSTALL_DIR/bin:.
export FBPATH
#
# update LD_LIBRARY_PATH for tcl/tk shared libs
#
LD_LIBRARY_PATH=${LD_LIBRARY_PATH:=}
LD_LIBRARY_PATH=/usr/lib:/usr/openwin/lib:/opt/SUNWconn/lib:/opt/SUNWconn/cmip/lib/shared:$INSTALL_DIR/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
#
# call interpreter with init file
#
#$INSTALL_DIR/bin/cat_wish $INSTALL_DIR/lib/CatPrjMgr/catgui
echo "source $INSTALL_DIR/lib/CatPrjMgr/cattool" | $INSTALL_DIR/bin/cat_wish
