Remove duplicate lines in BSD cpu detection

This commit is contained in:
Dylan 2016-01-19 17:36:10 +11:00
parent f4982c76f5
commit d521f5168e
1 changed files with 9 additions and 10 deletions

19
fetch
View File

@ -568,7 +568,6 @@ getcpu () {
;; ;;
*"BSD") *"BSD")
# TODO: Cpu speed for other BSD distros
case "$distro" in case "$distro" in
"OpenBSD") "OpenBSD")
# Get cpu name # Get cpu name
@ -580,18 +579,18 @@ getcpu () {
# Get cpu speed # Get cpu speed
speed=$(sysctl -n hw.cpuspeed) speed=$(sysctl -n hw.cpuspeed)
speed=$((speed / 100)) speed=$((speed / 100))
speed=${speed:0:1}.${speed:1}
cpu="$cpu @ ${speed}GHz"
;; ;;
"FreeBSD") "FreeBSD")
# Get cpu name
cpu="$(sysctl -n hw.model)" cpu="$(sysctl -n hw.model)"
cpu=${cpu/ @*/}
cpu=${cpu// /}
cpu=${cpu% }
# Get cpu speed
speed="$(sysctl -n hw.clockrate)" speed="$(sysctl -n hw.clockrate)"
speed=$((speed / 100)) speed=$((speed / 100))
speed=${speed:0:1}.${speed:1}
cpu="$cpu @ ${speed}GHz"
;; ;;
"NetBSD") "NetBSD")
@ -607,11 +606,11 @@ getcpu () {
speed=${speed/cpu MHz*: /} speed=${speed/cpu MHz*: /}
speed=${speed/\./} speed=${speed/\./}
speed=$((speed / 10000)) speed=$((speed / 10000))
speed=${speed:0:1}.${speed:1}
cpu="$cpu @ ${speed}GHz"
;; ;;
esac esac
speed=${speed:0:1}.${speed:1}
cpu="$cpu @ ${speed}GHz"
;; ;;
"Windows") "Windows")