]> git.pld-linux.org Git - packages/JXplorer.git/commitdiff
- detach from console
authorpawelz <pawelz@pld-linux.org>
Fri, 18 Jul 2008 13:59:38 +0000 (13:59 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- cosmetics

Changed files:
    JXplorer.sh -> 1.2

JXplorer.sh

index cedb518f4f647d85822cefb22c13e34f3115171e..b883cd602088c5c8a693a3f59d2fa5d6051c0d70 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"
 
@@ -15,45 +16,16 @@ if ! [ -d "$HOME/.JXplorer" ]; then
   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
+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.174774 seconds and 4 git commands to generate.