PADD (formerly Chronometer2) is a more expansive version of the original chronometer.sh that is included with Pi-Hole. PADD provides in-depth information about your Pi-hole.
1.37k
stars
121
forks
source link
System agnostic CPU core count - tested on Pine64 #33
Describe the bug Divide by 0 error because the string in /proc/cpuinfo does not exist outside of Raspberry Pi
To Reproduce
Expected behavior Correct corecount
Additional context I fixed it by using the /sys tree version of cpu count - hopefully this is usable on most kernels
Code change:
CORES
coreCount=$(grep -c 'model name' /proc/cpuinfo)
declare -i coreCount=1 coreCount=$(cat /sys/devices/system/cpu/kernel_max 2> /dev/null)+1
This works for me - reports 4 cores which is correct.
https://github.com/atiensivu/PADD/tree/atiensivu-patch-1