Turns out other *BSD distros don't have hw.cpuspeed

This commit is contained in:
Dylan 2016-01-18 17:37:00 +11:00
parent 432eb89e2d
commit 6f1ed5c0b7
1 changed files with 5 additions and 1 deletions

6
fetch
View File

@ -552,7 +552,7 @@ getcpu () {
cpu="$(sysctl -n machdep.cpu.brand_string)"
;;
*"BSD")
"OpenBSD")
cpu="$(sysctl -n hw.model)"
cpu=${cpu/ @*/}
cpu=${cpu// /}
@ -565,6 +565,10 @@ getcpu () {
cpu="$cpu @ ${speed}GHz"
;;
*"BSD")
cpu="$(sysctl -n hw.model)"
;;
"Windows")
# Get cpu name
cpu="$(grep -F 'model name' /proc/cpuinfo)"