mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-06-09 01:47:32 +08:00
Update progress.sh
This commit is contained in:
parent
8b01a58165
commit
86ea11db0f
@ -25,7 +25,7 @@ do
|
|||||||
if [ -s "$file" ]; then
|
if [ -s "$file" ]; then
|
||||||
bytes=$(du -sb "$file" | cut -f1)
|
bytes=$(du -sb "$file" | cut -f1)
|
||||||
if (( bytes > 1000 )); then
|
if (( bytes > 1000 )); then
|
||||||
if [ -z "$total" ]; then
|
if [ -z "$total" ] || [[ "$total" == "0" ]]; then
|
||||||
size=$(numfmt --to=iec --suffix=B "$bytes" | sed -r 's/([A-Z])/ \1/')
|
size=$(numfmt --to=iec --suffix=B "$bytes" | sed -r 's/([A-Z])/ \1/')
|
||||||
else
|
else
|
||||||
size=$(printf '%.1f\n' "$((bytes*100*100/total))e-2")
|
size=$(printf '%.1f\n' "$((bytes*100*100/total))e-2")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user