#!/bin/sh
# Do not edit this file. It is generated automatically.
# $Copyright: Copyright (c) 2009 Symantec Corporation.
# All rights reserved.
#
# THIS SOFTWARE CONTAINS CONFIDENTIAL INFORMATION AND TRADE SECRETS OF
# SYMANTEC CORPORATION.  USE, DISCLOSURE OR REPRODUCTION IS PROHIBITED
# WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SYMANTEC CORPORATION.
#
# The Licensed Software and Documentation are deemed to be commercial
# computer software as defined in FAR 12.212 and subject to restricted
# rights as defined in FAR Section 52.227-19 "Commercial Computer
# Software - Restricted Rights" and DFARS 227.7202, "Rights in
# Commercial Computer Software or Commercial Computer Software
# Documentation", as applicable, and any successor regulations. Any use,
# modification, reproduction release, performance, display or disclosure
# of the Licensed Software and Documentation by the U.S. Government
# shall be solely in accordance with the terms of this Agreement.  $
## $Source: /src/apps/eat2/Authentication/cli/src/vssat.src,v $
##$Id: vssat.src,v 1.3.2.7 2008/04/25 06:21:39 varwade Exp $
# 

# XPG/4 platform startup script for vssatbin

# determine the runtime location of the AT package
# source the location file (in case of non-standard installation location)
PKGNAME=VRTSat
VRTSAT_LOCFILE=/etc/vx/vss/${PKGNAME}.loc
unset INSTALLDIR

#EAT_HOME_DIR=
#EAT_DATA_DIR=
#EAT_CATALOG_DIR=

export EAT_HOME_DIR EAT_DATA_DIR EAT_CATALOG_DIR

if [ -z "$EAT_HOME_DIR" -a -f "$VRTSAT_LOCFILE" ] ; then
    echo "warning: environment variable EAT_HOME_DIR is not set, will attempt to use the shared AT instead."
    if [ -f "$VRTSAT_LOCFILE" -a -r "$VRTSAT_LOCFILE" ] ; then
        if [ -f "/bin/sed" -a -x "/bin/sed" ] ; then
            INSTALLDIR=`/bin/sed -e '/ProductInstallDir/{s/.*ProductInstallDir[ \t]*=[ \t]*//;p;d;}' -e 'd' $VRTSAT_LOCFILE`
	elif [ -f "/usr/bin/sed" -a -x "/usr/bin/sed" ] ; then
   	    INSTALLDIR=`/usr/bin/sed -e '/ProductInstallDir/{s/.*ProductInstallDir[ \t]*=[ \t]*//;p;d;}' -e 'd' $VRTSAT_LOCFILE`
	else
   	    INSTALLDIR=`sed -e '/ProductInstallDir/{s/.*ProductInstallDir[ \t]*=[ \t]*//;p;d;}' -e 'd' $VRTSAT_LOCFILE`
	fi
    fi
    # The ProductInstallDir variable points to the installation root
    VRTSAT_HOME=${INSTALLDIR-/opt/${PKGNAME}}
else
    if [ -z "$EAT_HOME_DIR" ] ; then
        echo "error: environment variable EAT_HOME_DIR is not set, unable to run AT CLI."
        exit 1
    else
        VRTSAT_HOME=$EAT_HOME_DIR
    fi
fi

# 64 bit clients are one directory deeper with 64 bit directory names
if [ -z "$EAT_HOME_DIR" ] ; then
	VRTSAT_64DIR_NAME=
else
	VRTSAT_64DIR_NAME=
fi

VRTSAT_BINDIR="$VRTSAT_HOME/bin$VRTSAT_64DIR_NAME"
VRTSAT_LIBDIR="$VRTSAT_HOME/lib$VRTSAT_64DIR_NAME"

OSNAME=`/bin/uname`
UNIX_VSSAT=vssatbin
EXEC_CMD=

case "$OSNAME"
in
	OSF1 )
		# Shared Library
		LD_LIBRARY_PATH="$VRTSAT_LIBDIR:$LD_LIBRARY_PATH"
		export LD_LIBRARY_PATH
		# echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
		;;

	Linux )
		# Shared Library
		LD_LIBRARY_PATH="$VRTSAT_LIBDIR:$LD_LIBRARY_PATH"
		export LD_LIBRARY_PATH
		# echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
        EXEC_CMD="exec"
		;;

	SunOS )
		# Shared Library
		LD_LIBRARY_PATH="$VRTSAT_LIBDIR:$LD_LIBRARY_PATH"
		export LD_LIBRARY_PATH
		# echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
		;;

	AIX ) 
		# Shared Library
		LIBPATH="$VRTSAT_LIBDIR:$LIBPATH"
		export LIBPATH
		# echo "LIBPATH=$LIBPATH"
		;;

	HP-UX )
		# Shared Library
		SHLIB_PATH="$VRTSAT_LIBDIR:$SHLIB_PATH"
		export SHLIB_PATH
		# echo "SHLIB_PATH=$SHLIB_PATH"
		;;

	Darwin )
		# Shared Library
		DYLD_LIBRARY_PATH="$VRTSAT_LIBDIR:$DYLD_LIBRARY_PATH"
		export DYLD_LIBRARY_PATH
		# echo "DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH"
		;;

	IRIX64 )
		# Shared Library
		LD_LIBRARY_PATH="$VRTSAT_LIBDIR:$LD_LIBRARY_PATH"
		export LD_LIBRARY_PATH
		# echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
		;;

	FreeBSD )
		# Shared Library
		LD_LIBRARY_PATH="$VRTSAT_LIBDIR:$LD_LIBRARY_PATH"
		export LD_LIBRARY_PATH
		# echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
		;;

	* )
		echo "$OSNAME: OS not supported!"
		exit 1
		;;
esac


$EXEC_CMD "$VRTSAT_BINDIR/$UNIX_VSSAT" "$@"

