2026-08-05 13:20:24 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
2026-10-05 12:37:42 -05:00
|
|
|
mounts=(
|
|
|
|
|
"/mnt/backup-10t"
|
|
|
|
|
"/mnt/backup-8t"
|
|
|
|
|
"/mnt/hermes"
|
|
|
|
|
"/mnt/primary-10t"
|
|
|
|
|
"/mnt/primary-8t"
|
2026-08-05 13:20:24 -05:00
|
|
|
)
|
|
|
|
|
|
2026-10-05 12:37:42 -05:00
|
|
|
for dir in "${mounts[@]}"; do
|
|
|
|
|
if ! mountpoint -q "$dir"; then
|
|
|
|
|
echo "Error: $dir is not mounted. Mount it before running this script." >&2
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
2026-08-05 13:20:24 -05:00
|
|
|
done
|
|
|
|
|
|
2026-10-05 12:37:42 -05:00
|
|
|
echo "Setting chmod 777 on all mount contents..."
|
|
|
|
|
for dir in "${mounts[@]}"; do
|
|
|
|
|
echo "Processing $dir..."
|
|
|
|
|
if ! chmod -R 777 "$dir"; then
|
|
|
|
|
echo "Error: failed to set permissions on $dir." >&2
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
2026-08-05 13:20:24 -05:00
|
|
|
done
|
|
|
|
|
|
2026-10-05 12:37:42 -05:00
|
|
|
echo "All permissions applied successfully."
|