square parens detection in list_mounted_tombs

This commit is contained in:
Jaromil 2017-12-11 13:05:03 +01:00
parent 6182a56fb6
commit 21347f3657

10
tomb
View File

@ -2272,10 +2272,13 @@ BEGIN { main="" }
main=$1
}
'
} || {
# list a specific tomb
} || { # list a specific tomb
# add square parens if not present
local tname
if [[ "${1[1]}" = "[" ]]; then tname=$1
else tname="[$1]"; fi
mount -l \
| awk -vtomb="[$1]" '
| awk -vtomb="$tname" '
BEGIN { main="" }
/^\/dev\/mapper\/tomb/ {
if($7!=tomb) next;
@ -2609,7 +2612,6 @@ umount_tomb() {
for t in ${mounted_tombs}; do
mapper=`basename ${t[(ws:;:)1]}`
# strip square parens from tombname
tombname=${t[(ws:;:)5]}
tombmount=${t[(ws:;:)2]}
tombfs=${t[(ws:;:)3]}