-
Notifications
You must be signed in to change notification settings - Fork 46
/
fits-env.sh
executable file
·45 lines (36 loc) · 1.13 KB
/
fits-env.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
#
# Sets up the environment for launching a FITS instance via
# either the fits.sh launcher, or the fits-ngserver.sh Nailgun server
FITS_ENV_SCRIPT="$0"
# Resolve symlinks to this script
while [ -h "$FITS_ENV_SCRIPT" ] ; do
ls=`ls -ld "$FITS_ENV_SCRIPT"`
# Drop everything prior to ->
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
FITS_ENV_SCRIPT="$link"
else
FITS_ENV_SCRIPT=`dirname "$FITS_ENV_SCRIPT"`/"$link"
fi
done
FITS_HOME=`dirname $FITS_ENV_SCRIPT`
export FITS_HOME
# Uncomment the following line if you want "file utility" to dereference and follow symlinks.
# export POSIXLY_CORRECT=1
# concatenate args and use eval/exec to preserve spaces in paths, options and args
args=""
for arg in "$@" ; do
args="$args \"$arg\""
done
# Application classpath
APPCLASSPATH=""
JCPATH=${FITS_HOME}/lib
# Add on extra jar files to APPCLASSPATH
for i in "$JCPATH"/*.jar; do
APPCLASSPATH="$APPCLASSPATH":"$i"
done
# optionally set Java maximum heap size
JAVA_OPTS=""
#JAVA_OPTS="-Xmx2048m"
# all subdirectories of ${FITS_HOME}/lib/ get loaded dynamically at runtime. DO NOT add here!