mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-06-07 17:07:58 +08:00
Update reset.sh
This commit is contained in:
parent
c5e39c47d2
commit
628c12934f
@ -112,13 +112,8 @@ fi
|
|||||||
|
|
||||||
formatBytes() {
|
formatBytes() {
|
||||||
local result
|
local result
|
||||||
result=$(numfmt --to=iec "$1")
|
result=$(numfmt --to=iec --suffix=B "$1" | sed -r 's/([A-Z])/ \1/' | sed 's/ B/ bytes/g;')
|
||||||
local unit="${result//[0-9. ]}"
|
local unit="${result//[0-9. ]}"
|
||||||
if [ -z "$unit" ]; then
|
|
||||||
unit="bytes"
|
|
||||||
else
|
|
||||||
unit=$(echo "${unit^^}" | sed 's/K/KB/g;s/M/MB/g;s/G/GB/g;s/T/TB/g')
|
|
||||||
fi
|
|
||||||
result="${result//[a-zA-Z ]/}"
|
result="${result//[a-zA-Z ]/}"
|
||||||
if [[ "${2:-}" == "up" ]]; then
|
if [[ "${2:-}" == "up" ]]; then
|
||||||
if [[ "$result" == *"."* ]]; then
|
if [[ "$result" == *"."* ]]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user