fix: version_from_partnum fix

This commit is contained in:
Peter Šurda 2021-02-28 09:35:39 +01:00
parent 0ffaf3c6e7
commit 2b7647b56d
Signed by: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -82,7 +82,8 @@ function version_from_partnum
local drive="$1"
local partnum="$2"
version="$(parted -m "$drive" -- print|awk -F: \
'{if (NR > 2 && $1 == "'"$partnum"') {
-v partnum="$partnum" \
'{if (NR > 2 && $1 == partnum) {
print $6
}}')"
version="$(echo "$version"|cut -d\ -f2)"