3
0
mirror of https://github.com/Qortal/Brooklyn.git synced 2025-01-31 07:12:18 +00:00
Brooklyn/temp-telegraf/telegraf_pi_temp.sh

7 lines
215 B
Bash

#!/bin/bash
prefix="temp="
suffix="'C"
gpu=$(/opt/vc/bin/vcgencmd measure_temp)
gpu_temp=${gpu#$prefix}
gpu_temp=${gpu_temp%$suffix}
echo -e "{\"cpu\":"$(</sys/class/thermal/thermal_zone0/temp)", \"gpu\":$gpu_temp}"