HEX
Server: Apache
System: Linux d15.hzone.ro 3.10.0-962.3.2.lve1.5.87.el7.x86_64 #1 SMP Tue Jan 28 09:38:56 UTC 2025 x86_64
User: velceapa (1444)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/velceapa/fix_perm.sh
#!/bin/bash

BASE_DIR="$(pwd)"
USER_NAME="$(id -un)"
GROUP_NAME="$(id -gn)"

echo "Base directory : $BASE_DIR"
echo "User           : $USER_NAME"
echo "Group          : $GROUP_NAME"
echo
echo "Searching for folders containing '.ro' ..."
echo

# Find directories with .ro in the name
find "$BASE_DIR" -type d -name '*\.ro*' | while read -r RO_DIR; do
    echo "Fixing: $RO_DIR"

    # Ownership
    chown -R "$USER_NAME:$GROUP_NAME" "$RO_DIR"

    # Directory permissions
    find "$RO_DIR" -type d -exec chmod 755 {} \;

    # File permissions
    find "$RO_DIR" -type f -exec chmod 644 {} \;

    echo "✔ Done: $RO_DIR"
    echo
done

echo "✅ All '.ro' folders processed."