From 7a80bca9bed235df9b2b2d3ca01c0fe765201154 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Thu, 30 Dec 2010 15:46:11 +0100 Subject: bugfix: allow any kind of blockdevice to be queried for uuid/label, not just hd/sd partitions --- src/core/libs/lib-blockdevices-filesystems.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/core/libs/lib-blockdevices-filesystems.sh') diff --git a/src/core/libs/lib-blockdevices-filesystems.sh b/src/core/libs/lib-blockdevices-filesystems.sh index 742245f..298c4d2 100644 --- a/src/core/libs/lib-blockdevices-filesystems.sh +++ b/src/core/libs/lib-blockdevices-filesystems.sh @@ -190,8 +190,8 @@ $ANSWER_DEVICES" # returns: nothing getuuid() { - [ -z "$1" ] && die_error "getuuid needs an argument" - [ "${1%%/[hs]d?[0-9]}" != "${1}" ] && echo "$(blkid -s UUID -o value ${1})" + [ -n "$1" -a -b "$1" ] || die_error "getuuid needs a device file argument" + echo "$(blkid -s UUID -o value ${1})" } @@ -201,8 +201,8 @@ getuuid() # returns: nothing getlabel() { - [ -z "$1" ] && die_error "getlabel needs an argument" - [ "${1%%/[hs]d?[0-9]}" != "${1}" ] && echo "$(blkid -s LABEL -o value ${1})" + [ -n "$1" -a -b "$1" ] || die_error "getlabel needs a device file argument" + echo "$(blkid -s LABEL -o value ${1})" } # find partitionable blockdevices -- cgit v1.2.3-54-g00ecf