#!/bin/bash PROJECT_DIR="$(cd "$(dirname "$0")" && pwd)" WEB_USER="www-data" cd "$PROJECT_DIR" || exit 1 echo "Fixing permissions..." # Fix ownership (only if running as root/sudo, skip otherwise) if [ "$(id -u)" -eq 0 ]; then chown -R "$WEB_USER":"$WEB_USER" storage bootstrap/cache 2>/dev/null || true fi # Fix directory permissions find storage bootstrap/cache -type d -exec chmod 775 {} + 2>/dev/null || true find storage bootstrap/cache -type f -exec chmod 664 {} + 2>/dev/null || true echo "Permissions fixed."