Round up host RAM. Closes #11

Avoid "integer expression expected" errors when host RAM enumeration returns a floating point value.

  * https://github.com/wimpysworld/quickemu/issues/11
pull/18/head
Martin Wimpress 5 years ago
parent fb082f1079
commit 142eac3001
No known key found for this signature in database
GPG Key ID: 61DF940515E06DA3
  1. 2
      quickemu

@ -199,6 +199,8 @@ function vm_boot() {
local RAM_VM="2G"
local RAM_HOST=$(free --mega -h | grep Mem | cut -d':' -f2 | cut -d'G' -f1 | sed 's/ //g')
#Round up - https://github.com/wimpysworld/quickemu/issues/11
RAM_HOST=$(printf '%.*f\n' 0 ${RAM_HOST})
if [ ${RAM_HOST} -ge 64 ]; then
RAM_VM="4G"
elif [ ${RAM_HOST} -ge 16 ]; then

Loading…
Cancel
Save