]> git.pld-linux.org Git - packages/JXplorer.git/blob - JXplorer.sh
- BR sed 4
[packages/JXplorer.git] / JXplorer.sh
1 #!/bin/sh
2
3 JX_OPTS=-Djxplorer.config="$HOME/.JXplorer"
4 JX_JAVADIR=/usr/share/java/JXplorer
5 JX_DATADIR=/usr/share/JXplorer
6
7 [ -r /etc/sysconfig/jxplorer ] && . /etc/sysconfig/jxplorer
8
9 JAVA_BIN="$JAVA_HOME/bin/java"
10
11 if ! [ -d "$HOME/.JXplorer" ]; then
12   mkdir "$HOME/.JXplorer"
13   cp /etc/JXplorer/connections.txt "$HOME/.JXplorer/connections.txt"
14   ln -s /etc/JXplorer/log4j.xml "$HOME/.JXplorer/log4j.xml"
15   ln -s /etc/JXplorer/jxconfig.txt "$HOME/.JXplorer/jxconfig.txt"
16 fi
17
18 echo "starting JXplorer..."
19 echo
20 FAIL=0
21 cd "$JX_DATADIR"
22 CLASSPATH=`build-classpath junit jhall`
23 CLASSPATH="$CLASSPATH:$JX_JAVADIR/jxplorer.jar:$JX_JAVADIR/help.jar"
24 export CLASSPATH
25 if [ "$1" = "console" ] ; then
26     "$JAVA_BIN" $JX_OPTS com.ca.directory.jxplorer.JXplorer
27
28     if [ "$?" != "0" ]; then
29         FAIL=1
30     fi
31 else
32     echo "Use \"$0 console\" if you want logging to the console"
33     "$JAVA_BIN" $JX_OPTS com.ca.directory.jxplorer.JXplorer  >/dev/null 2>&1
34
35     if [ "$?" != "0" ]; then
36         FAIL=1
37     fi
38 fi
39
40 # Check for success
41 if [ $FAIL = 0 ]; then
42     exit 0
43 fi
44
45 cat <<-!
46
47 =========================
48 JXplorer failed to start
49 =========================
50 Please ensure that you have appropriate "xhost" access to the machine you are
51 running this from. Make sure the DISPLAY environment variable is set correctly.
52 Otherwise, ask your Unix Systems Administrator for more information on running
53 X Windows applications.
54
55 If you require more information run "$0 console" and check the
56 error produced.
57 !
58
59 exit 1
This page took 0.034348 seconds and 3 git commands to generate.