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

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

cd ${PATHWAY_INSTALL_DIR}

#
# The following line starts up the Sun 3270 Pathway Navigation Recorder.
#
java -jar lib/pathway_recorder.jar $*
