mirror of
https://github.com/kyantech/Palmr.git
synced 2025-11-02 13:03:15 +00:00
Simplify nested conditional in server-start.sh
Co-authored-by: danielalves96 <62755605+danielalves96@users.noreply.github.com>
This commit is contained in:
@@ -11,18 +11,16 @@ echo "🔧 Runtime UID/GID: $TARGET_UID:$TARGET_GID"
|
||||
# Check if we need to update ownership
|
||||
# Only run chown if explicitly configured via environment variables
|
||||
# This prevents unnecessary slowdowns on default configurations
|
||||
if [ -n "$PALMR_UID" ] || [ -n "$PALMR_GID" ]; then
|
||||
if [ "$(id -u)" = "0" ]; then
|
||||
echo "🔐 Updating file ownership to match runtime configuration..."
|
||||
chown -R $TARGET_UID:$TARGET_GID /app/palmr-app 2>/dev/null || echo "⚠️ Some ownership changes may have failed"
|
||||
chown -R $TARGET_UID:$TARGET_GID /home/palmr 2>/dev/null || echo "⚠️ Some home directory ownership changes may have failed"
|
||||
|
||||
if [ -d "/app/server" ]; then
|
||||
chown -R $TARGET_UID:$TARGET_GID /app/server 2>/dev/null || echo "⚠️ Some data directory ownership changes may have failed"
|
||||
fi
|
||||
|
||||
echo "✅ UID/GID configuration completed"
|
||||
if ([ -n "$PALMR_UID" ] || [ -n "$PALMR_GID" ]) && [ "$(id -u)" = "0" ]; then
|
||||
echo "🔐 Updating file ownership to match runtime configuration..."
|
||||
chown -R $TARGET_UID:$TARGET_GID /app/palmr-app 2>/dev/null || echo "⚠️ Some ownership changes may have failed"
|
||||
chown -R $TARGET_UID:$TARGET_GID /home/palmr 2>/dev/null || echo "⚠️ Some home directory ownership changes may have failed"
|
||||
|
||||
if [ -d "/app/server" ]; then
|
||||
chown -R $TARGET_UID:$TARGET_GID /app/server 2>/dev/null || echo "⚠️ Some data directory ownership changes may have failed"
|
||||
fi
|
||||
|
||||
echo "✅ UID/GID configuration completed"
|
||||
fi
|
||||
|
||||
cd /app/palmr-app
|
||||
|
||||
Reference in New Issue
Block a user