fix perms script

This commit is contained in:
2025-10-18 14:23:46 -05:00
parent eef0c8cf27
commit 27fb031175

View File

@@ -28,21 +28,21 @@ in {
# Fix ownership for archives directory
echo "starting ${archives_path}"
chown -Rc root:archives ${archives_path}
chmod -Rc 2770 ${archives_path}
find "${archives_path}" -type d -exec sh -c 'chown root:archives "$@" chmod 770 "$@"' _ {} +
find "${archives_path}" -type f -exec sh -c 'chown root:archives "$@" chmod 660 "$@"' _ {} +
# Fix ownership for media directory
echo "starting ${media_path}"
chown -Rc root:media ${media_path}
chmod -Rc 2770 ${media_path}
find "${media_path}" -type d -exec sh -c 'chown root:media "$@" chmod 770 "$@"' _ {} +
find "${media_path}" -type f -exec sh -c 'chown root:media "$@" chmod 660 "$@"' _ {} +
# Fix user directories
for user_dir in ${users_path}/*; do
if [ -d "$user_dir" ]; then
user=$(basename "$user_dir")
echo "starting $user_dir"
chown -Rc "$user:$user" "$user_dir"
chmod -Rc 770 "$user_dir"
find "$user_dir" -type d -exec sh -c 'chown $user:$user "$@" chmod 770 "$@"' _ {} +
find "$user_dir" -type f -exec sh -c 'chown $user:$user "$@" chmod 660 "$@"' _ {} +
fi
done
echo "fin"