From 92fac8ccd1275e8d035cc6b77286ea01869199c3 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Thu, 5 Oct 2023 15:17:25 +0200 Subject: [PATCH] Update 00-local_mounts.sh --- .templates/00-local_mounts.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.templates/00-local_mounts.sh b/.templates/00-local_mounts.sh index f3e7ffc75..8f2b321a2 100755 --- a/.templates/00-local_mounts.sh +++ b/.templates/00-local_mounts.sh @@ -37,17 +37,18 @@ if bashio::config.has_value 'localdisks'; then disk="${disk##*/}" # Function to check what is the type of device - if lsblk | grep -q "^$1"; then - echo "... $disk is a physical device." + if [ -e /dev/"$disk" ]; then + echo "... $disk is a physical device" devpath=/dev - elif lsblk -o UUID | grep -q "$1"; then - echo "... $disk is a device by UUID." + elif 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 "$1"; then - echo "... $disk is a device by label." + elif lsblk -o LABEL | grep -q "$disk"; then + echo "... $disk is a device by label" devpath=/dev/disk/by-label else - echo "$disk does not match any known physical device, UUID, or label." + bashio::log.fatal "$disk does not match any known physical device, UUID, or label. " + sleep 1m fi # Creates dir