From eca602461ac5af8c1e3692af6409e17396d407d3 Mon Sep 17 00:00:00 2001 From: Jay MOULIN Date: Sun, 22 Dec 2024 22:30:37 +0100 Subject: [PATCH] Fixes kill trap signal + test on fake uid --- daemon.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/daemon.sh b/daemon.sh index 339e4c5..1acfef8 100755 --- a/daemon.sh +++ b/daemon.sh @@ -1,6 +1,6 @@ #!/bin/sh -trap 'kill -TERM $PID' TERM INT +trap 'kill -SIGTERM $PID' TERM INT rm -f /opt/JDownloader/app/JDownloader.jar.* 2> /dev/null rm -f /opt/JDownloader/app/JDownloader.pid 2> /dev/null @@ -62,7 +62,7 @@ if echo "$UMASK" | grep -Eq '0[0-7]{3}' ; then umask "$UMASK" fi -if [ -m "$PUID" ]; then +if [ -n "$PUID" ]; then su jdown -s /bin/sh -c 'java -Dsun.jnu.encoding=UTF-8 -Dfile.encoding=UTF-8 -Djava.awt.headless=true -jar /opt/JDownloader/app/JDownloader.jar -norestart' & else java -Dsun.jnu.encoding=UTF-8 -Dfile.encoding=UTF-8 -Djava.awt.headless=true -jar /opt/JDownloader/app/JDownloader.jar -norestart & @@ -73,5 +73,4 @@ do wait $PID PID=`pgrep java` done -wait $PID # don't alter exit status EXIT_STATUS=$?