#!/bin/sh java_bin=/usr/bin textdomaindir=/opt/lanman/lib/locale textdomain='slsmgr' logfile=/tmp/slsmgr.log # # Function to run gettext with TEXTDOMAINDIR set. # TEXTDOMAINDIR is not set in the exported environment so subprocesses # do not inadvertently use it. # pgettext () { gttext=gettext #Trick to fool shgettext TEXTDOMAINDIR=${textdomaindir} ${gttext} ${textdomain} "$1" } check_version() { version=`${java_bin}/java -version 2>&1` echo "${version}" | \ /usr/bin/awk 'BEGIN {FS="."} \ {if (((NF==2) && ($2>=2)) || \ ((NF==3) && (($2>=2) || ($3>=6)))) {exit 0} \ else {exit 1}}' if [ $? -ne 0 ]; then eval echo "\"`pgettext '\nThe version of java installed on this machine is ${version}.\nThis is an unsupported version of java.\nPlease exit and install version 1.1.6 or later.\nExit now? [y|n] '`\c\"" read ans junk if [ "${ans}" = "n" -o "${ans}" = "no" ]; then continue else exit 1 fi fi } check_xhost() { if [ X"$DISPLAY" = X ]; then DISPLAY=":0.0" export DISPLAY fi /usr/openwin/bin/xhost > /dev/null 2>&1 if [ $? -ne 0 ]; then eval echo "\"`pgettext '\nYou do not have access to the display ${DISPLAY}.\nUse the xhost command to enable access.\nExit now? [y|n] '`\c\"" read ans junk if [ "${ans}" = "n" -o "${ans}" = "no" ]; then continue else exit 1 fi fi } if [ -x ${java_bin}/java ]; then check_version check_xhost cd `dirname $0`/../lib CLASSPATH=java/client.jar:java/common.jar:java/HotJavaBean.jar:java/swing.jar export CLASSPATH unset JAVA_HOME unset JDK_HOME # Need to I18N!!! pgettext "starting SunLink Server Manager\n" exec /usr/bin/java com.sun.sls.internal.panels.MainPage > $logfile 2>&1 else # Need to I18N!!! pgettext "Could not find Java Runtime Environment. You must install the Java Runtime Environment.\n" exit 1 fi