#!/usr/bin/ksh
################################################################################
#Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. 
#
#This script is to run SunVTS Graphical User Interface:
################################################################################
#check if user is a valid user for accessing SunVTS
userAuth()
{
	userinfo=`id | awk '{print $1}'`
	userinfo=`echo $userinfo | awk '{i=index($1,"(");j=index($1,")");print substr($1,i+1,j-i-1)}'`

	if [ "$userinfo" != "root" ]; then
		echo "Access Denied. You need root or superuser privileges"
		exit -4
	fi

}

userAuth;

SUCCESS=0
FAIL=1

#Append native library path to special env variable LD_LIBRARY_PATH
#When JVM loads, the value from env variable is appened to java.library.path property
 
LD_LIBRARY_PATH=/usr/sunvts/bin/gui/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
java -jar /usr/sunvts/bin/gui/SunVTSGUI.jar 2>/dev/null

