Add ability to specify a UID and GID

This commit is contained in:
gotofoo 2017-03-04 23:24:03 +01:00
parent cb23e460a4
commit 08cb2da105
2 changed files with 24 additions and 8 deletions

View file

@ -7,11 +7,30 @@ function stopJD2 {
exit
}
if [ "$GID" ]
then
GROUP=jdownloader
groupadd -g $GID $GROUP
else
GROUP=root
fi
if [ "$UID" ]
then
USER=jdownloader
useradd -r -s /bin/false -u $UID -g $GROUP $USER
chown -R $USER:$GROUP /opt/JDownloader
else
USER=root
fi
trap stopJD2 EXIT
java -Djava.awt.headless=true -jar /opt/JDownloader/JDownloader.jar &
su -c "java -Djava.awt.headless=true -jar /opt/JDownloader/JDownloader.jar" -s /bin/bash $USER
while true; do
sleep inf
done
#java -Djava.awt.headless=true -jar /opt/JDownloader/JDownloader.jar &
#while true; do
# sleep inf
#done