From 9de6138cbaf94c88a8cac01705bbbbd3af04c44d Mon Sep 17 00:00:00 2001 From: Manuel Montecelo Date: Tue, 25 Sep 2018 16:13:15 +0200 Subject: [PATCH] TT#11444 Fix calculation of the size of swapfile The code was using old, non-existing variable names from previous versions of the code. Change-Id: Ia5fc090fbd37cc54d6a353d8792e6e1b8cca4e90 --- templates/scripts/includes/deployment.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/scripts/includes/deployment.sh b/templates/scripts/includes/deployment.sh index 34863b1..3899aae 100755 --- a/templates/scripts/includes/deployment.sh +++ b/templates/scripts/includes/deployment.sh @@ -1360,9 +1360,9 @@ fi # TT#11444 Calculate size of swapfile ramsize_mb="$(( $(awk '/^MemTotal:/ {print $2}' /proc/meminfo) / 1024))" SWAPFILE_SIZE_MB="$(( ramsize_mb / 2))" -if [[ "${swapsize_mb}" -lt "${SWAPFILE_SIZE_MB_MIN}" ]]; then +if [[ "${SWAPFILE_SIZE_MB}" -lt "${SWAPFILE_SIZE_MB_MIN}" ]]; then SWAPFILE_SIZE_MB="${SWAPFILE_SIZE_MB_MIN}" -elif [[ "${swapsize_mb}" -gt "${SWAPFILE_SIZE_MB_MAX}" ]]; then +elif [[ "${SWAPFILE_SIZE_MB}" -gt "${SWAPFILE_SIZE_MB_MAX}" ]]; then SWAPFILE_SIZE_MB="${SWAPFILE_SIZE_MB_MAX}" fi unset ramsize_mb