1
0
mirror of https://github.com/Spearfoot/FreeNAS-scripts synced 2025-12-06 01:23:19 +00:00

Displays drive capacity and formatting handles 10 or more CPUs

This commit is contained in:
Keith Nash
2017-05-13 07:53:44 -05:00
committed by GitHub
parent fd36c34e4d
commit 2904638584

View File

@@ -45,12 +45,12 @@ cores=$(sysctl -a | grep "hw.ncpu" | awk '{print $2}')
printf "=== CPU (%s) ===\n" "${cores}"
cores=$((cores - 1))
for core in $(seq 0 $cores); do
temp="$(sysctl -a | grep "cpu.${core}.temp" | cut -c24-25 | tr -d "\n")"
if [ "$temp" -lt 0 ]; then
temp="--n/a--"
else
temp="${temp}C"
fi
temp="$(sysctl -a | grep "cpu.${core}.temp" | cut -c24-25 | tr -d "\n")"
if [ "$temp" -lt 0 ]; then
temp="--n/a--"
else
temp="${temp}C"
fi
printf "CPU %2.2s: %5s\n" "$core" "$temp"
done
echo ""