We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5ed07ec commit 0b74eebCopy full SHA for 0b74eeb
discourse-setup
@@ -1,4 +1,6 @@
1
#!/usr/bin/env bash
2
+export LC_ALL=C # lscpu output is localized.
3
+
4
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
5
cd $DIR
6
@@ -258,7 +260,7 @@ scale_ram_and_cpu() {
258
260
else
259
261
avail_gb=$(check_linux_memory)
262
threads_per_core=$(lscpu | awk 'BEGIN {FS=":"} /Thread\(s\) per core/ {print $2}')
- avail_cores=$((`lscpu | awk '/^CPU\(s\)/ {print $2}'`*${threads_per_core}))
263
+ avail_cores=$((`lscpu | awk '/^CPU\(s\):[[:blank:]]+[0-9]+[[:blank:]]*$/ {print $2; exit}'`*${threads_per_core}))
264
fi
265
echo "Found ${avail_gb}GB of memory and $avail_cores physical CPU cores"
266
0 commit comments