From 3b087cad6278da9e808dde2549c0355bdb1d3fc8 Mon Sep 17 00:00:00 2001 From: Keith Nash Date: Fri, 30 Jun 2017 13:05:03 -0500 Subject: [PATCH] Check for missing CPU temp as a string instead of arithmetically --- get_hdd_temp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/get_hdd_temp.sh b/get_hdd_temp.sh index f49d92f..6b1bb9f 100644 --- a/get_hdd_temp.sh +++ b/get_hdd_temp.sh @@ -47,7 +47,7 @@ cores=$((cores - 1)) for core in $(seq 0 $cores); do # temp="$(sysctl -a | grep "cpu.${core}.temp" | cut -c24-25 | tr -d "\n")" temp=$(sysctl -a | grep "cpu.${core}.temperature" | awk '{print $2}') - if [ "$temp" -lt 0 ]; then + if [ "$temp" -eq '-1' ]; then temp="--n/a--" else temp="${temp}C"