Update mdev/dmcache.mdev
Add license identifier and description.
This commit is contained in:
parent
ce178b3b35
commit
da9ac7e87d
@ -1,25 +1,30 @@
|
||||
#!/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"
|
||||
#!/bin/sh
|
||||
|
||||
# mdev script to mask dm-cache origin device's FS UUID
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Copyright 2023 Forza <forza@tnonline.net>
|
||||
|
||||
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"
|
||||
|
Loading…
Reference in New Issue
Block a user