Skip to content

Commit

Permalink
Fixes kill trap signal + test on fake uid
Browse files Browse the repository at this point in the history
  • Loading branch information
jaymoulin committed Dec 22, 2024
1 parent 8988523 commit eca6024
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions daemon.sh
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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 &
Expand All @@ -73,5 +73,4 @@ do
wait $PID
PID=`pgrep java`
done
wait $PID # don't alter exit status
EXIT_STATUS=$?

0 comments on commit eca6024

Please sign in to comment.