Last active
May 28, 2024 09:44
-
-
Save leosuncin/50367b3c905fe8699b13bd85ad26071b to your computer and use it in GitHub Desktop.
JDownloader 2 headless startup script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
DESC="JDownloader 2 Headless" | |
NAME=JDownloader2 | |
PIDFILE=/var/run/$NAME.pid | |
COMMAND="/usr/bin/java -- -Djava.awt.headless=true -jar /home/osmc/jDownloader2/JDownloader.jar" | |
RUN_AS=osmc | |
d_start() { | |
start-stop-daemon --start --quiet --background --make-pidfile --pidfile $PIDFILE --chuid $RUN_AS --exec $COMMAND | |
} | |
d_stop() { | |
start-stop-daemon --stop --quiet --pidfile $PIDFILE | |
if [ -e $PIDFILE ] | |
then rm $PIDFILE | |
fi | |
} | |
case $1 in | |
start) | |
echo -n "Starting $DESC: $NAME" | |
d_start | |
echo "." | |
;; | |
stop) | |
echo -n "Stopping $DESC: $NAME" | |
d_stop | |
echo "." | |
;; | |
restart) | |
echo -n "Restarting $DESC: $NAME" | |
d_stop | |
sleep 1 | |
d_start | |
echo "." | |
;; | |
*) | |
echo "usage: $NAME {start|stop|restart}" | |
exit 1 | |
;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think is not possible, JDownloader avoids to open multiple windows, so, one process only. Use the web interface or the app of JDownloader.