Fix blank cpu speed on DragonFlyBSD

This commit is contained in:
Dylan 2016-05-13 09:22:44 +10:00
parent 5a87bed817
commit 11c869b50e
1 changed files with 2 additions and 1 deletions

View File

@ -1105,7 +1105,8 @@ getcpu () {
cpu=${cpu/ @*}
# 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))
# Get cpu cores