Fix floating point math

This commit is contained in:
the Sane 2021-02-20 18:01:13 -05:00 committed by GitHub
parent 96b15262f5
commit aec6ffbfc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -641,7 +641,7 @@ filelimit_check() {
# Check total system memory
memory_check() {
memtotal="$(awk '/MemTotal/ {printf "%.1f \n", $2/1024/1024}' /proc/meminfo)"
if awk 'BEGIN {exit !("$memtotal" > 15)}'; then
if [ ${memtotal%.*} -ge "15" ]; then
preflight_pass+=("Your system has $memtotal GB of memory.")
else
preflight_fail+=("Your system has $memtotal GB of memory.\nWe recommend at least 16 GB to avoid crashes.")