View Single Post
  #3  
Old 16.06.2021, 09:41
ultrahigh ultrahigh is offline
Mega Loader
 
Join Date: Feb 2016
Posts: 65
Default

Wie finde ich den Pfad raus zu Java ?

Das ist wohl das Script:
Code:
:/var/packages/JDownloader/scripts$ cat start-stop-status
#!/bin/sh

# @version      2015-09-20
# @env          run by DSM, $SYNOPKG_PKGDEST example: "/volume1/@appstore/JDownloader"

source /etc/profile

JAVA_BIN="${JAVA_HOME}/bin/java"
JAVA_OPTIONS="-Djava.awt.headless=true -jar"
SYNOPKG_PKGDEST="/volume1/@appstore/JDownloader"
DAEMON="${SYNOPKG_PKGDEST}/JDownloader.jar"
PIDFILE="${SYNOPKG_PKGDEST}/JDownloader.pid"
PACKAGE_NAME="JDownloader"
LOGFILE="/volume1/Downloads/JDownloader.log"

export LC_ALL=en_US.utf8
export LANG=en_US.utf8

case $1 in
    start)
        if [ ! -f $PIDFILE ]; then
            nohup ${JAVA_BIN} ${JAVA_OPTIONS} ${DAEMON} >>$LOGFILE 2>&1 &
            echo "$PACKAGE_NAME started ..."
        elif PID=$(cat $PIDFILE) && [ -e /proc/${PID} -a /proc/${PID}/exe ];
        then
            echo "$PACKAGE_NAME is already running ..."
        else
            echo "$PACKAGE_NAME process has invalid pid, cleaning up..."
            rm $PIDFILE
            nohup ${JAVA_BIN} ${JAVA_OPTIONS} ${DAEMON} >>$LOGFILE 2>&1 &
         fi
    ;;
    stop)
        PID=$(cat $PIDFILE)
        if [ -f $PIDFILE ]; then
            kill $PID;
            echo "$PACKAGE_NAME stopped ..."
        else
            echo "$PACKAGE_NAME is not running ..."
        fi
    ;;
    restart)
        PID=$(cat $PIDFILE)
        if [ -f $PIDFILE ]; then
            kill $PID;
            echo "$PACKAGE_NAME stopped ..."
            echo "$PACKAGE_NAME re-starting ..."
                        sleep 1
            nohup ${JAVA_BIN} ${JAVA_OPTIONS} ${DAEMON} >>$LOGFILE 2>&1 &
                        sleep 1
            echo "$PACKAGE_NAME re-started ..."
        else
            echo "$PACKAGE_NAME is not running ..."
        fi
    ;;
    status)
            sleep 1
        if [ ! -f $PIDFILE ]; then
                echo "$PACKAGE_NAME is stopped ..."
                exit 1
        else
                echo "$PACKAGE_NAME is running ..."
                exit 0
        fi
    ;;
    log)
        echo "$LOGFILE"
    ;;
    checkpw)
            cat ${SYNOPKG_PKGDEST}/cfg/org.jdownloader.api.myjdownloader.MyJDownloaderSettings.json|grep -E "email|password"    ;;
    setpw)
            echo "Enter your email address: "
            read email
            echo "Enter your password: "
            read password
            echo -ne "{\n  \"email\" : \"${email}\",\n  \"password\" : \"${password}\"\n}\n" >${SYNOPKG_PKGDEST}/cfg/org.jdownloader.api.myjdownloader.MyJDownloaderSettings.json
    ;;
    enable)
            touch /var/packages/JDownloader/enabled
    ;;
    disable)
            rm /var/packages/JDownloader/enabled
    ;;
    *)
            echo -e "$PACKAGE_NAME package\n\nUsage:\n\t$0 (start|stop|restart|status|log|checkpw|setpw|enable|disable)\n"
    ;;
esac
exit 0

Last edited by ultrahigh; 16.06.2021 at 09:46.