Avoid to compute disk many times
This commit is contained in:
parent
34e0f1cf6d
commit
a4f4f41a7b
|
@ -56,6 +56,7 @@ do
|
||||||
case $DEV in
|
case $DEV in
|
||||||
/dev/drbd/*)
|
/dev/drbd/*)
|
||||||
DISK=$(cat $LVSOUT | awk "/$VM/ { ans += \$NF } END { print ans / 1024 ^ 3 }")
|
DISK=$(cat $LVSOUT | awk "/$VM/ { ans += \$NF } END { print ans / 1024 ^ 3 }")
|
||||||
|
break # avoid to compute DISK for each disk
|
||||||
;;
|
;;
|
||||||
*.qcow2)
|
*.qcow2)
|
||||||
DISK=$(du -sBG $DEV | awk '{ print substr($1, 0, length($1) - 1) }')
|
DISK=$(du -sBG $DEV | awk '{ print substr($1, 0, length($1) - 1) }')
|
||||||
|
|
Loading…
Reference in a new issue