[go: up one dir, main page]

Menu

[r22683]: / tags / v1 / Jmol / jmol  Maximize  Restore  History

Download this file

40 lines (34 with data), 860 Bytes

#!/bin/sh

# Collect -D options as java arguments
command=java
while [ `echo $1 | egrep '^-D' | wc -l` != 0 ]; do
	command="$command $1"
	shift
done

# Determine installation location
if [ "$JMOL_HOME" = "" ]; then
	binDir=${0%/*}
	if [ "$binDir" = "$0" ]; then
		# Ran from local directory
		binDir=$PWD
	fi
	# Resolve symlinks.
	program="$0"
	while [ -L "$program" ]; do
		ls=`/bin/ls -ld "$program"`
		link=`/usr/bin/expr "$ls" : '.*-> \(.*\)$'`
		if /usr/bin/expr "$link" : '.*/.*' > /dev/null; then
		program="$link"
		else
		program="`/usr/bin/dirname $program`/$link"
		fi
	done
	binDir=`dirname $program`
fi

JMOL_HOME=${JMOL_HOME:-$binDir}
libDir=${JMOL_HOME}/jars

if [ ! -e $libDir/jmol.jar ]; then
	echo "Jmol could not find its installed files."
	exit
fi

exec $command -Djmol.home="$JMOL_HOME" -cp $libDir/jmol.jar org.openscience.jmol.Jmol "$@"