]> git.pld-linux.org Git - packages/JXplorer.git/blobdiff - JXplorer.sh
- use local plugins and templates directories
[packages/JXplorer.git] / JXplorer.sh
index cedb518f4f647d85822cefb22c13e34f3115171e..34141531acb15e612b4415e0a7cdbbfedaaae9c3 100644 (file)
@@ -4,7 +4,8 @@ JX_OPTS=-Djxplorer.config="$HOME/.JXplorer"
 JX_JAVADIR=/usr/share/java/JXplorer
 JX_DATADIR=/usr/share/JXplorer
 
-[ -r /etc/sysconfig/jxplorer ] && . /etc/sysconfig/jxplorer
+# Get config.
+[ -f /etc/sysconfig/jxplorer ] && . /etc/sysconfig/jxplorer
 
 JAVA_BIN="$JAVA_HOME/bin/java"
 
@@ -12,48 +13,21 @@ 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"
+  cp /etc/JXplorer/jxconfig.txt "$HOME/.JXplorer/jxconfig.txt"
+  ln -s $JX_DATADIR/templates "$HOME/.JXplorer/templates"
+  ln -s $JX_DATADIR/security "$HOME/.JXplorer/security"
 fi
 
-echo "starting JXplorer..."
-echo
-FAIL=0
-cd "$JX_DATADIR"
+cd "$HOME/.JXplorer"
 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
+if [ "$#" == "0" ]; then
+    exec "$JAVA_BIN" $JX_OPTS com.ca.directory.jxplorer.JXplorer < /dev/null > /dev/null 2>&1 &
+  else if [ "$1" = "console" ] ; then
+    exec "$JAVA_BIN" $JX_OPTS com.ca.directory.jxplorer.JXplorer
+  else
+    echo "Usage: $0 [console|help]"
+  fi
 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
This page took 0.104359 seconds and 4 git commands to generate.