#!/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" "$PROJECT_DIR" 2>/dev/null || true fi # Fix directory permissions for writable paths chmod -R 775 storage bootstrap/cache 2>/dev/null || true echo "Permissions fixed."