Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
#!/bin/sh
# Already running as non-root (e.g. Unraid --user flag) — skip privilege setup
if [ "$(id -u)" != "0" ]; then
exec "$@"
fi

# Ensure data and fleet directories are writable by cashpilot
chown cashpilot:root /data 2>/dev/null || true
if [ -d "/fleet" ]; then
chown cashpilot:root /fleet 2>/dev/null || true
fi

# If Docker socket exists, ensure the cashpilot user can access it
SOCK=/var/run/docker.sock
if [ -S "$SOCK" ]; then
Expand All @@ -12,9 +23,4 @@ if [ -S "$SOCK" ]; then
fi
fi

# Ensure fleet key directory is writable by cashpilot
if [ -d "/fleet" ]; then
chown cashpilot:root /fleet 2>/dev/null || true
fi

exec su-exec cashpilot "$@"
Loading