#!/bin/ksh
#
# Copyright (c) 2003 by Sun Microsystems, Inc.
# All rights reserved.
#
# Start Sun MTP J3270 Terminal.
#
# This script assumes that it is located in the bin directory of the
# installed J3270 product. If it is moved, then the J3270_INSTALL_DIR
# environment variable can be set to override the calculations here.
#

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

cd ${J3270_INSTALL_DIR}

#
# The following line starts up the Sun MTP J3270 Terminal.
#
java -jar lib/j3270.jar $*
