„scripts/start.sh“ ändern

This commit is contained in:
2021-01-10 17:23:55 +01:00
parent 5f263b7159
commit 051e3659a8

View File

@@ -17,5 +17,22 @@ fi
echo "---Starting...---"
chown -R ${UID}:${GID} /opt/scripts
chown -R ${UID}:${GID} ${DATA_DIR}
su ${USER} -c "/opt/scripts/start-server.sh"
term_handler() {
kill -SIGTERM "$killpid"
wait "$killpid" -f 2>/dev/null
exit 143;
}
trap 'kill ${!}; term_handler' SIGTERM
if [ "${SAVE_LOG}" == "true" ]; then
/opt/scripts/start-server.sh 2>&1 | tee ${DATA_DIR}/"$(date +'%Y-%m-%d_%H.%M.%S')".log &
else
/opt/scripts/start-server.sh &
fi
killpid="$!"
while true
do
wait $killpid
exit 0;
done