Fix blank cpu speed on DragonFlyBSD

This commit is contained in:
Dylan 2016-05-13 09:22:44 +10:00
parent 5a87bed817
commit 11c869b50e

View file

@ -1105,7 +1105,8 @@ getcpu () {
cpu=${cpu/ @*} cpu=${cpu/ @*}
# Get cpu speed # Get cpu speed
speed=$(sysctl -n hw.cpuspeed hw.clockrate 2>/dev/null) speed=$(sysctl -n hw.cpuspeed)
[ -z "$speed" ] && speed=$(sysctl -n hw.clockrate)
speed=$((speed / 100)) speed=$((speed / 100))
# Get cpu cores # Get cpu cores