Hotfix for bad CPU output on ARM machines

This commit is contained in:
Mason Rowe 2021-06-10 23:18:06 -04:00 committed by GitHub
parent 857e14efe8
commit 773220d760
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -172,8 +172,9 @@ else
fi
echo -e "Processor : $CPU_PROC"
if [[ $ARCH = *aarch64* || $ARCH = *arm* ]]; then
CPU_CORES=$(lscpu | grep "CPU(s):" | sed 's/CPU(s): *//g')
CPU_CORES=$(lscpu | grep "^[[:blank:]]*CPU(s):" | sed 's/CPU(s): *//g')
CPU_FREQ=$(lscpu | grep "CPU max MHz" | sed 's/CPU max MHz: *//g')
[[ -z "$CPU_FREQ" ]] && CPU_FREQ="???"
CPU_FREQ="${CPU_FREQ} MHz"
else
CPU_CORES=$(awk -F: '/model name/ {core++} END {print core}' /proc/cpuinfo)