From 965686730d277f45636d030c17be9046dab77793 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Teemu=20Heikkil=C3=A4?= Date: Fri, 28 Oct 2016 21:37:46 +0300 Subject: [PATCH] Fix physical core calculation --- discourse-setup | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discourse-setup b/discourse-setup index 8026da0..45c7696 100755 --- a/discourse-setup +++ b/discourse-setup @@ -134,8 +134,8 @@ scale_ram_and_cpu() { avail_gb=$(check_osx_memory) avail_cores=`sysctl hw.ncpu | awk '/hw.ncpu:/ {print $2}'` else - avail_gb=$(check_linux_memory) - avail_cores=`cat /proc/cpuinfo | grep "cpu cores" | uniq | awk '{print $4}'` + avail_gb=$(check_linux_memory) + avail_cores=$((`awk '/cpu cores/ {print $4;exit}' /proc/cpuinfo`*`sort /proc/cpuinfo | uniq | grep -c "physical id"`)) fi echo "Found ${avail_gb}GB of memory and $avail_cores physical CPU cores" -- 2.25.1