calculate average temp with sysctl values
This commit is contained in:
17
bin/st-temp
17
bin/st-temp
@ -2,10 +2,17 @@
|
|||||||
CPUTEMP=$(sensors | grep "Package id 0" | awk '{print $4}' | sed s/+// )
|
CPUTEMP=$(sensors | grep "Package id 0" | awk '{print $4}' | sed s/+// )
|
||||||
|
|
||||||
# freebsd
|
# freebsd
|
||||||
# calculate average from all cores (unfinished)
|
#CORETEMPS=$(sysctl dev.cpu | grep temperature | awk '{print $2}' | sed s/.[0-9]C$//g)
|
||||||
#CORETEMPS=$(hwstat | grep CPU | awk '{print $2}')
|
#
|
||||||
|
#CORE_COUNT=0
|
||||||
# report only core 0 temp for now...
|
#SUM=0
|
||||||
CPUTEMP="$(hwstat | grep CPU | awk 'NR==1 {print $2}')°C"
|
#
|
||||||
|
#for temp in $CORETEMPS; do
|
||||||
|
# SUM=$((SUM + temp))
|
||||||
|
# CORE_COUNT=$((CORE_COUNT + 1))
|
||||||
|
#done
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#CPUTEMP="$((SUM / CORE_COUNT)) C"
|
||||||
|
|
||||||
echo $CPUTEMP
|
echo $CPUTEMP
|
||||||
|
|||||||
Reference in New Issue
Block a user