From 0fbe2709eae18532e43aa37311b8c08371fd7162 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Sat, 8 Oct 2016 21:40:05 -0700 Subject: [PATCH] bash cannot handle float arithmetic --- installer/systemd/box-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installer/systemd/box-setup.sh b/installer/systemd/box-setup.sh index cede0eba4..c58a283cd 100755 --- a/installer/systemd/box-setup.sh +++ b/installer/systemd/box-setup.sh @@ -17,7 +17,7 @@ sed -e 's/.* \(ssh-rsa.*\)/\1/' -i /root/.ssh/authorized_keys readonly physical_memory=$(free -m | awk '/Mem:/ { print $2 }') readonly swap_size="${physical_memory}" # if you change this, fix enoughResourcesAvailable() in client.js readonly app_count=$((${physical_memory} / 200)) # estimated app count -readonly disk_size_gb=$(fdisk -l ${disk_device} | grep "Disk ${disk_device}" | awk '{ print $3 }') +readonly disk_size_gb=$(fdisk -l ${disk_device} | grep "Disk ${disk_device}" | awk '{ printf "%.0f", $3 }') readonly disk_size=$((disk_size_gb * 1024)) readonly system_size=10240 # 10 gigs for system libs, apps images, installer, box code and tmp readonly ext4_reserved=$((disk_size * 5 / 100)) # this can be changes using tune2fs -m percent /dev/vda1