File: cockpitlite.sh

package info (click to toggle)
jets3t 0.8.1%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, sid, trixie
  • size: 5,816 kB
  • sloc: java: 39,293; xml: 431; sh: 212; makefile: 30
file content (88 lines) | stat: -rw-r--r-- 2,473 bytes parent folder | download | duplicates (3)
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
88
#!/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:-""}

# 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
    export JAVA_HOME="/usr/lib/jvm/default-java"
  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-cockpitlite.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-Lite" org.jets3t.apps.cockpitlite.CockpitLite
 else
  "$EXEC" $MAXMEM -classpath "$CP" org.jets3t.apps.cockpitlite.CockpitLite
fi