File: cockpit.sh

package info (click to toggle)
jets3t 0.7.4+dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 5,572 kB
  • ctags: 4,635
  • sloc: java: 36,486; xml: 433; sh: 214; makefile: 26
file content (87 lines) | stat: -rw-r--r-- 2,422 bytes parent folder | download
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/sh
# -------------------------------------------------------------------
# Environmental variables:
#
# JETS3T_HOME  Points to the home directory of a JetS3t distribution.
#
# JAVA_HOME    The home directory of the Java Runtime Environment or 
#              Java Development Kit to use. 
# -------------------------------------------------------------------

: ${JETS3T_HOME:="/usr/share/jets3t"}
: ${JAVA_HOME:="/usr/lib/jvm/default-java"}

# Check the JETS3T_HOME directory

if [ -z "$JETS3T_HOME" ]; then
  # Try to find the home directory, assuming this script is in $JETS3T_HOME/bin
  SCPT_DIR=`dirname $0`
  if [ "$SCPT_DIR" = "." ]; then
    JETS3T_HOME=..
  else    
    JETS3T_HOME=`dirname $SCPT_DIR`
  fi
fi

if [ ! -d $JETS3T_HOME/jars ]; then
  echo "Please set the environment variable JETS3T_HOME"
  exit 1
fi

# Check the JAVA_HOME directory
if [ -z "$JAVA_HOME" ]; then
  # Test whether the 'java' program is available in the system path.
  java -version 2> /dev/null
  if [ $? -gt 0 ]; then
    echo "Please set the environment variable JAVA_HOME"
    exit 1
  else
    EXEC=java
  fi
else
  EXEC=$JAVA_HOME/bin/java
fi

# -------------------------------------------------------------------

# Include configurations directory in classpath
CP=$CLASSPATH:$JETS3T_HOME/configs

# Include resources directory in classpath
CP=$CP:$JETS3T_HOME/resources

# System libraries path
: ${JAVA_LIBS:="/usr/share/java"}

# Include libraries in classpath
CP=$CP:$JAVA_LIBS/jets3t.jar
CP=$CP:$JAVA_LIBS/jets3t-gui.jar
CP=$CP:$JAVA_LIBS/jets3t-cockpit.jar
CP=$CP:$JAVA_LIBS/jets3t-deps.jar
CP=$CP:$JAVA_LIBS/commons-logging.jar
CP=$CP:$JAVA_LIBS/commons-codec.jar
CP=$CP:$JAVA_LIBS/commons-httpclient.jar
CP=$CP:$JAVA_LIBS/log4j-1.2.jar
CP=$CP:$JAVA_LIBS/bcprov.jar

# Convert classpath for cygwin bash
case "`uname -s`" in
    CYGWIN*)
        CYGWIN_CP=""
        for cp_path in $(echo $CP | tr ':' '\n'); do
            CWIN_PATH=$(cygpath -w -a "$cp_path")
            CYGWIN_CP="$CYGWIN_CP;$CWIN_PATH"
        done
        CP=$CYGWIN_CP
esac

# OutOfMemory errors? Increase the memory available by changing -Xmx256M
MAXMEM=-Xmx256M

# Run application with special arguments on OS X (Darwin) systems.
if [ `uname -s` = "Darwin" ]
then
  "$EXEC" $MAXMEM -classpath "$CP" -Xdock:name="JetS3t Cockpit" org.jets3t.apps.cockpit.Cockpit
 else
  "$EXEC" $MAXMEM -classpath "$CP" org.jets3t.apps.cockpit.Cockpit
fi