„scripts/start.sh“ ändern

This commit is contained in:
2020-05-13 22:43:30 +02:00
parent 99e123806e
commit 6f236f5680

View File

@@ -19,4 +19,22 @@ echo "---Starting...---"
chown -R ${UID}:${GID} /opt/scripts
chown -R ${UID}:${GID} ${DATA_DIR}
chown -R ${UID}:${GID} /tmp/hello.py
su ${USER} -c "/opt/scripts/start-server.sh"
killpid=0
term_handler() {
if [ $killpid -ne 0 ]; then
kill -SIGTERM "$killpid"
wait "$killpid"
fi
exit 143;
}
trap 'kill ${!}; term_handler' SIGTERM
su ${USER} -c "/opt/scripts/start-server.sh" &
killpid="$!"
while true
do
if ! pgrep -f start-server.sh >/dev/null ; then
exit 0
fi
sleep 5
done