dm-cache/mdev/dmcache.mdev
Forza 1a95f201d9 Upload files to "mdev"
mdev rules for masking origin filesystem UUID
2023-11-24 08:40:07 +01:00

26 lines
529 B
Bash

#!/bin/sh
uuid_file="/etc/dmcache-uuids"
# Check if the file exists
if [ ! -f "$uuid_file" ]; then
echo "Error: File '$uuid_file' not found."
exit 1
fi
# Loop through each UUID in the file and remove the corresponding symlink
while IFS= read -r uuid; do
if [ -z "$uuid" ] || [ "${uuid:0:1}" = "#" ]; then
continue
fi
symlink="/dev/disk/by-uuid/$uuid"
# Check if the symlink exists
if [ -L "$symlink" ]; then
echo "Removing symlink: $symlink"
rm "$symlink"
fi
done < "$uuid_file"