#!/bin/ksh
#**********************************************************************#
#*                                                                    *#
#* Copyright (c) 2002 by Sun Microsystems, Inc.                       *#
#* All rights reserved.                                               *#
#*                                                                    *#
#**********************************************************************#

#-----------------------------------------------------------------------
# Startup script for the Sun Mainframe Administration Tool.
#-----------------------------------------------------------------------

#---
# This script assumes that it is located in the bin directory of the
# installed admin tool. If it is moved, then the ADMIN_INSTALL_DIR environment
# variable can be set to override the calculations here.
#---

#
# Determine where the installation of ADMIN is.
#
if [ "$ADMIN_INSTALL_DIR"A = "A" ]; then
    D=`dirname $0`
    B=`basename $0`
    abspath="`cd \"$D\" 2>/dev/null && pwd || echo \"$D\"`/$B"
    ADMIN_INSTALL_DIR=`dirname $(dirname $abspath)`
else
    if [ -f "${ADMIN_INSTALL_DIR}/lib/sunmat.jar" ]; then
	echo "Using admin installation directory '"$ADMIN_INSTALL_DIR"'"
    else
	echo "Could not find '"${ADMIN_INSTALL_DIR}"/lib/sunmat.jar'"
	exit 1
    fi
fi

#
# Now invoke the java command
#
java -jar $ADMIN_INSTALL_DIR/lib/sunmat.jar $*
