-
-
Save leosuncin/50367b3c905fe8699b13bd85ad26071b to your computer and use it in GitHub Desktop.
#!/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 |
I use this on a raspberry, but JDownloader doesnt start at boot.
@fabme1 add a cronjob
@fabme1 you can also try this script: https://gist.github.com/atiris/34dc670264274b3a472f2a718e4de83a
I use this on a raspberry, but JDownloader doesnt start at boot.
i make some changes,it should work now
Thanks for the startup script.
Problem is when the daemon is running on the background I can't start the JDownloader GUI.
How could I be able to run it on background but still open the GUI when needed?
Thanks for the startup script.
Problem is when the daemon is running on the background I can't start the JDownloader GUI.
How could I be able to run it on background but still open the GUI when needed?
I think is not possible, JDownloader avoids to open multiple windows, so, one process only. Use the web interface or the app of JDownloader.
Bau250: Install JDownloader as normal. Fire up the gui (export DISPLAY=YOUREMOTEX:0; java -jar path/to/JDownloader.jar) and click the tab in the GUI marked "MyJDownloader" and enter the account settings from the website after your signed up there.. http://my.jdownloader.org
JD will save you settings, and you can exit the program and use it headless again and control it with the android client or the web interface, what have you.