Change 1024 to 1000 for gigabytes

This commit is contained in:
Wes
2023-05-30 17:28:59 +00:00
parent 5af1bfe142
commit b441fe662f

View File

@@ -21,13 +21,13 @@ for i in $(/usr/sbin/so-elasticsearch-query _cat/allocation | awk '{print $2}');
size=$(echo $i | grep -oE '[0-9].*' | awk '{print int($1+0.5)}')
unit=$(echo $i | grep -oE '[A-Za-z]+')
if [ $unit = "tb" ]; then
size=$(( size * 1024 * 1024 * 1024 * 1024 ))
size=$(( size * 1000 * 1000 * 1000 * 1000<F12> ))
elif [ $unit = "gb" ]; then
size=$(( size * 1024 * 1024 * 1024 ))
size=$(( size * 1000 * 1000 * 1000 ))
elif [ $unit = "mb" ]; then
size=$(( size * 1024 * 1024 ))
size=$(( size * 1000 * 1000 ))
elif [ $unit = "kb" ]; then
size=$(( size * 1024 ))
size=$(( size * 1000 ))
elif [ $unit = "b" ]; then
size=size
fi