mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-02 01:58:40 +00:00
Fix ownership check in docker entrypoint script
This commit is contained in:
parent
78dd5b6489
commit
c48da8ccd7
1 changed files with 4 additions and 4 deletions
|
@ -1,11 +1,11 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
log() {
|
log() {
|
||||||
local type="$1"; shift
|
type="$1"; shift
|
||||||
printf '%s [%s] [Entrypoint]: %s\n' "$(date -Iseconds)" "$type" "$*"
|
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
|
if [ ! -d "/lighthouse/data" ]; then
|
||||||
log Note "Creating data directory"
|
log Note "Creating data directory"
|
||||||
|
@ -13,7 +13,7 @@ if [ ! -d "/lighthouse/data" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
owner=$(stat -c "%U %G" /lighthouse/data)
|
owner=$(stat -c "%U %G" /lighthouse/data)
|
||||||
if [ owner != "lighthouse lighthouse" ]; then
|
if [ "$owner" != "lighthouse lighthouse" ]; then
|
||||||
log Note "Changing ownership of data directory"
|
log Note "Changing ownership of data directory"
|
||||||
chown -R lighthouse:lighthouse /lighthouse/data
|
chown -R lighthouse:lighthouse /lighthouse/data
|
||||||
fi
|
fi
|
||||||
|
@ -27,7 +27,7 @@ fi
|
||||||
# Start server
|
# Start server
|
||||||
|
|
||||||
log Note "Startup tasks finished, starting $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
|
exec su-exec lighthouse:lighthouse dotnet /lighthouse/app/LBPUnion.ProjectLighthouse.Servers."$SERVER".dll
|
||||||
|
|
||||||
exit $? # Expose error code from dotnet command
|
exit $? # Expose error code from dotnet command
|
Loading…
Add table
Add a link
Reference in a new issue