Olli Graf
1 year ago
1 changed files with 20 additions and 0 deletions
@ -0,0 +1,20 @@ |
|||||
|
#! /usr/bin/bash |
||||
|
|
||||
|
# Replacement for Raspberry Pi OS' vcgencmd on non Raspian SBC |
||||
|
|
||||
|
cpu_temp=$(cat /sys/class/thermal/thermal_zone0/temp) |
||||
|
gpu_temp=$(cat /sys/class/thermal/thermal_zone0/temp) |
||||
|
|
||||
|
function print_temp { |
||||
|
ftemp=${2:0:2} |
||||
|
|
||||
|
ftemp+="." |
||||
|
ftemp+=${2:2:1} |
||||
|
|
||||
|
echo "temp="${ftemp} |
||||
|
} |
||||
|
|
||||
|
cpu_temp=$(cat /sys/class/thermal/thermal_zone0/temp) |
||||
|
cpu_temp=$(cat /sys/class/thermal/thermal_zone1/temp) |
||||
|
print_temp "CPU=" "${cpu_temp}" |
||||
|
#print_temp "GPU=" "${gpu_temp}" |
Loading…
Reference in new issue