From c48da8ccd74cbd6f0cff181262897d7a3fdfb3d7 Mon Sep 17 00:00:00 2001 From: Slendy Date: Fri, 24 Feb 2023 00:45:05 -0600 Subject: [PATCH] Fix ownership check in docker entrypoint script --- scripts-and-tools/docker-entrypoint.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts-and-tools/docker-entrypoint.sh b/scripts-and-tools/docker-entrypoint.sh index 13beb189..b39a2b4c 100644 --- a/scripts-and-tools/docker-entrypoint.sh +++ b/scripts-and-tools/docker-entrypoint.sh @@ -1,11 +1,11 @@ #!/bin/sh log() { - local type="$1"; shift + type="$1"; shift printf '%s [%s] [Entrypoint]: %s\n' "$(date -Iseconds)" "$type" "$*" } -log Note "Entrypoint script for Lighthouse $SERVER started". +log Note "Entrypoint script for Lighthouse $SERVER started" if [ ! -d "/lighthouse/data" ]; then log Note "Creating data directory" @@ -13,7 +13,7 @@ if [ ! -d "/lighthouse/data" ]; then fi owner=$(stat -c "%U %G" /lighthouse/data) -if [ owner != "lighthouse lighthouse" ]; then +if [ "$owner" != "lighthouse lighthouse" ]; then log Note "Changing ownership of data directory" chown -R lighthouse:lighthouse /lighthouse/data fi @@ -27,7 +27,7 @@ fi # Start server log Note "Startup tasks finished, starting $SERVER..." -cd /lighthouse/data +cd /lighthouse/data || exit exec su-exec lighthouse:lighthouse dotnet /lighthouse/app/LBPUnion.ProjectLighthouse.Servers."$SERVER".dll exit $? # Expose error code from dotnet command \ No newline at end of file