From 7770c9a3cd301c1b6f4970b739b2b5cd3663a5e3 Mon Sep 17 00:00:00 2001 From: Dylan Date: Sun, 21 Feb 2016 08:30:23 +1100 Subject: [PATCH] Remove duplicate blocks in getcpu --- fetch | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/fetch b/fetch index 494f8a5a..75f98c2f 100755 --- a/fetch +++ b/fetch @@ -774,7 +774,7 @@ getcpu () { cpu="$(sysctl -n machdep.cpu.brand_string)" ;; - *"BSD") + *"BSD" | "Windows") case "$distro" in "OpenBSD"* | "FreeBSD"*) # Get cpu name @@ -791,7 +791,7 @@ getcpu () { speed=$((speed / 100)) ;; - "NetBSD"*) + "NetBSD"* | "Windows"*) # Get cpu name cpu="$(grep -F 'model name' /proc/cpuinfo)" cpu=${cpu/model name*: } @@ -811,25 +811,6 @@ getcpu () { cpu="$cpu @ ${speed}GHz" ;; - "Windows") - # Get cpu name - cpu="$(grep -F 'model name' /proc/cpuinfo)" - cpu=${cpu/model name*: } - cpu=${cpu/ @*} - cpu=${cpu// } - cpu=${cpu% } - - # Get cpu speed - speed=$(grep -F 'cpu MHz' /proc/cpuinfo) - speed=${speed/cpu MHz*: } - speed=${speed/\.} - - # Convert mhz to ghz without bc - speed=$((speed / 100000)) - speed=${speed:0:1}.${speed:1} - cpu="$cpu @ ${speed}GHz" - ;; - *) cpu="Unknown" ;;