summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/libs/lib-blockdevices-filesystems.sh8
1 files changed, 4 insertions, 4 deletions
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