mirror of
https://github.com/the-sane/lug-helper.git
synced 2024-12-28 02:14:18 +00:00
Round memory checks to whole numbers to fix integer errors
This commit is contained in:
parent
e7c7ad5cba
commit
eefa0d00e8
@ -917,10 +917,10 @@ memory_check() {
|
|||||||
swaptotal="$(($swaptotal * 1024))"
|
swaptotal="$(($swaptotal * 1024))"
|
||||||
combtotal="$(($memtotal + $swaptotal))"
|
combtotal="$(($memtotal + $swaptotal))"
|
||||||
|
|
||||||
# Convert to GiB
|
# Convert to whole number GiB
|
||||||
memtotal="$(numfmt --to=iec-i --suffix="B" "$memtotal")"
|
memtotal="$(numfmt --to=iec-i --format="%.0f" --suffix="B" "$memtotal")"
|
||||||
swaptotal="$(numfmt --to=iec-i --suffix="B" "$swaptotal")"
|
swaptotal="$(numfmt --to=iec-i --format="%.0f" --suffix="B" "$swaptotal")"
|
||||||
combtotal="$(numfmt --to=iec-i --suffix="B" "$combtotal")"
|
combtotal="$(numfmt --to=iec-i --format="%.0f" --suffix="B" "$combtotal")"
|
||||||
|
|
||||||
if [ "${memtotal: -3}" != "GiB" ] || [ "${memtotal::-3}" -lt "$memory_required" ]; then
|
if [ "${memtotal: -3}" != "GiB" ] || [ "${memtotal::-3}" -lt "$memory_required" ]; then
|
||||||
# Minimum requirements are not met
|
# Minimum requirements are not met
|
||||||
|
Loading…
Reference in New Issue
Block a user