SOURCES: JXplorer.sh (NEW) - Script for running JXplorer

pawelz pawelz at pld-linux.org
Wed Jul 16 22:26:07 CEST 2008


Author: pawelz                       Date: Wed Jul 16 20:26:07 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- Script for running JXplorer

---- Files affected:
SOURCES:
   JXplorer.sh (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/JXplorer.sh
diff -u /dev/null SOURCES/JXplorer.sh:1.1
--- /dev/null	Wed Jul 16 22:26:08 2008
+++ SOURCES/JXplorer.sh	Wed Jul 16 22:26:02 2008
@@ -0,0 +1,59 @@
+#!/bin/sh
+
+JX_OPTS=-Djxplorer.config="$HOME/.JXplorer"
+JX_JAVADIR=/usr/share/java/JXplorer
+JX_DATADIR=/usr/share/JXplorer
+
+[ -r /etc/sysconfig/jxplorer ] && . /etc/sysconfig/jxplorer
+
+JAVA_BIN="$JAVA_HOME/bin/java"
+
+if ! [ -d "$HOME/.JXplorer" ]; then
+  mkdir "$HOME/.JXplorer"
+  cp /etc/JXplorer/connections.txt "$HOME/.JXplorer/connections.txt"
+  ln -s /etc/JXplorer/log4j.xml "$HOME/.JXplorer/log4j.xml"
+  ln -s /etc/JXplorer/jxconfig.txt "$HOME/.JXplorer/jxconfig.txt"
+fi
+
+echo "starting JXplorer..."
+echo
+FAIL=0
+cd "$JX_DATADIR"
+CLASSPATH=`build-classpath junit jhall`
+CLASSPATH="$CLASSPATH:$JX_JAVADIR/jxplorer.jar:$JX_JAVADIR/help.jar"
+export CLASSPATH
+if [ "$1" = "console" ] ; then
+    "$JAVA_BIN" $JX_OPTS com.ca.directory.jxplorer.JXplorer
+
+    if [ "$?" != "0" ]; then
+        FAIL=1
+    fi
+else
+    echo "Use \"$0 console\" if you want logging to the console"
+    "$JAVA_BIN" $JX_OPTS com.ca.directory.jxplorer.JXplorer  >/dev/null 2>&1
+
+    if [ "$?" != "0" ]; then
+        FAIL=1
+    fi
+fi
+
+# Check for success
+if [ $FAIL = 0 ]; then
+    exit 0
+fi
+
+cat <<-!
+
+=========================
+JXplorer failed to start
+=========================
+Please ensure that you have appropriate "xhost" access to the machine you are
+running this from. Make sure the DISPLAY environment variable is set correctly.
+Otherwise, ask your Unix Systems Administrator for more information on running
+X Windows applications.
+
+If you require more information run "$0 console" and check the
+error produced.
+!
+
+exit 1
================================================================


More information about the pld-cvs-commit mailing list