mirror of
https://github.com/Spearfoot/FreeNAS-scripts
synced 2025-12-10 21:33:20 +00:00
Check for missing CPU temp as a string instead of arithmetically
This commit is contained in:
@@ -47,7 +47,7 @@ cores=$((cores - 1))
|
|||||||
for core in $(seq 0 $cores); do
|
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}.temp" | cut -c24-25 | tr -d "\n")"
|
||||||
temp=$(sysctl -a | grep "cpu.${core}.temperature" | awk '{print $2}')
|
temp=$(sysctl -a | grep "cpu.${core}.temperature" | awk '{print $2}')
|
||||||
if [ "$temp" -lt 0 ]; then
|
if [ "$temp" -eq '-1' ]; then
|
||||||
temp="--n/a--"
|
temp="--n/a--"
|
||||||
else
|
else
|
||||||
temp="${temp}C"
|
temp="${temp}C"
|
||||||
|
|||||||
Reference in New Issue
Block a user