From ee524983cdbf5a76a762ad5e26e972fb2e01fdfe Mon Sep 17 00:00:00 2001 From: PlusMinus Date: Fri, 28 Aug 2015 15:39:01 +0200 Subject: [PATCH] When an update in JD2 was triggered and it restarted, the docker stopped. The added script should: a) prevent it b) kill JD gradually, when docker stop is being executed on this container --- startJD2.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 startJD2.sh diff --git a/startJD2.sh b/startJD2.sh new file mode 100755 index 0000000..ca0382d --- /dev/null +++ b/startJD2.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +function stopJD2 { + PID=$(cat JDownloader.pid) + kill $PID + wait $PID + exit +} + +trap stopJD2 EXIT + +java -Djava.awt.headless=true -jar JDownloader.jar + +while true; do + sleep inf +done +