Skip to content

Commit eca6024

Browse files
committed
Fixes kill trap signal + test on fake uid
1 parent 8988523 commit eca6024

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

daemon.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
trap 'kill -TERM $PID' TERM INT
3+
trap 'kill -SIGTERM $PID' TERM INT
44
rm -f /opt/JDownloader/app/JDownloader.jar.* 2> /dev/null
55
rm -f /opt/JDownloader/app/JDownloader.pid 2> /dev/null
66

@@ -62,7 +62,7 @@ if echo "$UMASK" | grep -Eq '0[0-7]{3}' ; then
6262
umask "$UMASK"
6363
fi
6464

65-
if [ -m "$PUID" ]; then
65+
if [ -n "$PUID" ]; then
6666
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' &
6767
else
6868
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
7373
wait $PID
7474
PID=`pgrep java`
7575
done
76-
wait $PID # don't alter exit status
7776
EXIT_STATUS=$?

0 commit comments

Comments
 (0)