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