Bug fix/enhancement: Check if we're the owner of /data and set ownership if not. Also pre-create /data/models folder

This commit is contained in:
SergeantPanda 2025-11-04 09:03:39 -06:00
parent d15d8f6644
commit 93f074241d

View file

@ -9,6 +9,7 @@ DATA_DIRS=(
"/data/m3us"
"/data/epgs"
"/data/plugins"
"/data/models"
)
APP_DIRS=(
@ -56,5 +57,11 @@ if [ "$(id -u)" = "0" ]; then
chown -R postgres:postgres /data/db
fi
# Fix /data directory ownership (non-recursive)
if [ -d "/data" ] && [ "$(stat -c '%u:%g' /data)" != "$PUID:$PGID" ]; then
echo "Fixing ownership for /data (non-recursive)"
chown $PUID:$PGID /data
fi
chmod +x /data
fi