Avoid to compute disk many times

This commit is contained in:
Alexis Ben Miloud--Josselin 2018-06-08 14:16:57 +02:00
parent 34e0f1cf6d
commit a4f4f41a7b
1 changed files with 1 additions and 0 deletions

View File

@ -56,6 +56,7 @@ do
case $DEV in
/dev/drbd/*)
DISK=$(cat $LVSOUT | awk "/$VM/ { ans += \$NF } END { print ans / 1024 ^ 3 }")
break # avoid to compute DISK for each disk
;;
*.qcow2)
DISK=$(du -sBG $DEV | awk '{ print substr($1, 0, length($1) - 1) }')