Search directly for disk in by-label and by-uuid

This commit is contained in:
Alexandre
2024-04-27 22:28:12 +02:00
committed by GitHub
parent 1037b406e5
commit e34490c711

View File

@@ -40,10 +40,10 @@ if bashio::config.has_value 'localdisks'; then
if [ -e /dev/"$disk" ]; then
echo "... $disk is a physical device"
devpath=/dev
elif lsblk -o UUID | grep -q "$disk"; then
elif [ -e /dev/disk/by-uuid/"$disk" ] || lsblk -o UUID | grep -q "$disk"; then
echo "... $disk is a device by UUID"
devpath=/dev/disk/by-uuid
elif lsblk -o LABEL | grep -q "$disk"; then
elif [ -e /dev/disk/by-label/"$disk" ] || lsblk -o LABEL | grep -q "$disk"; then
echo "... $disk is a device by label"
devpath=/dev/disk/by-label
else