From 128c6a1c76317d2e4c74475dfd17d28b04e680fd Mon Sep 17 00:00:00 2001 From: Luis Garcia Date: Wed, 24 Jul 2024 02:09:04 -0600 Subject: [PATCH] Fix missing logs/mark folder if set --- entrypoint.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index 4fad465..bf8b72a 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -24,5 +24,19 @@ fi # Adjust ownership of the application directory chown -R "$PUID:$PGID" /app +# Get directory of log and mark file to create base folder if it doesnt exist and change permissions +LOG_DIR=$(dirname "$LOGFILE") +# If LOG_DIR is set, create the directory +if [ -n "$LOG_DIR" ]; then + mkdir -p "$LOG_DIR" + chown -R "$PUID:$PGID" "$LOG_DIR" +fi + +MARK_DIR=$(dirname "$MARKFILE") +if [ -n "$MARK_DIR" ]; then + mkdir -p "$MARK_DIR" + chown -R "$PUID:$PGID" "$MARK_DIR" +fi + # Run the application as the created user exec gosu "$PUID:$PGID" "$@"