#!/bin/sh 

# 
#  @(#)start-diag	1.9 01/01/22
#
#  Copyright (c) 01/22/01 Sun Microsystems, Inc.  All Rights Reserved
#
#  @version 1.9 01/01/22 17:27:30
#
# 

##
# jdk OR jre
##
##JAVA_ED_ENV=jdk
JAVA_ED_ENV=jre2 
export JAVA_ED_ENV 

dirname=`/bin/dirname $0`
if [ -d $dirname ]; then
	## Set the I18N/L10N environment
	if [ -f $dirname/common.sh ]; then
		. $dirname/common.sh
	fi
else
	## this will be a simple echo
	/bin/gettext "Can not determine where start-diag is"
	echo ""
	exit 1
fi

export BASE_PATH

thisArgs=$*

if [ $# -lt 1 ]; then
	if [ -x $BASE_PATH/lib/server/hd-server.sh ] ; then
		$BASE_PATH/lib/server/hd-server.sh
		exit 0
	fi
	exit 1
fi

if [ $# -lt 3 ]; then
## for comp reason
	userInput="$1"
	if [ ${userInput} = "-server" ];  then
		if [ -x $BASE_PATH/lib/server/hd-server.sh ] ; then
			$BASE_PATH/lib/server/hd-server.sh
			exit 0
		fi
		exit 1
	fi
	/bin/gettext "start-diag usage:"
	echo ""
	/bin/gettext "start-diag -server starts the Hardware Diagnostic Suite Server"
	echo ""
	exit 1
fi


if [  -x $BASE_PATH/lib/ui/hd-console.sh ] ; then
		$BASE_PATH/lib/ui/hd-console.sh $thisArgs
fi

