From df45e39d42b59a37278d3c5840152ac25b8b5667 Mon Sep 17 00:00:00 2001 From: Kris Lamoureux Date: Wed, 30 Nov 2022 01:54:20 -0500 Subject: [PATCH] Follow block device symlinks --- debianzfs.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/debianzfs.sh b/debianzfs.sh index 88846c5..63c21ae 100755 --- a/debianzfs.sh +++ b/debianzfs.sh @@ -20,7 +20,9 @@ function usage () { } function disk_check () { - DISK_TYPE=$(file "$1" | awk '{ print $2$3 }') + DISK="$1" + [ -L "$DISK" ] && DISK=$(readlink -f "$DISK") + DISK_TYPE=$(file "$DISK" | awk '{ print $2$3 }') if [ "$DISK_TYPE" != "blockspecial" ]; then echo "ERROR: Disk '$1' is not a block device" exit 1