Files
pistress/bin/measure_temp.sh
2026-06-02 11:19:43 +00:00

27 lines
412 B
Bash
Executable File

#!/bin/bash
START=$(date +%s)
usage() {
local name=${0##*/}
cat <<-EOF
Usage: ${name} [-h || --help]
measures the cpu's core temperature and writes it with a timestamp to stdout.
EOF
}
if [[ "$1" == "-h" || "$1" == "--help" ]]; then
usage
exit 0
fi
while true; do
NOW=$(date +%s)
TS=$((NOW - START))
TEMP=$(vcgencmd measure_temp | sed 's/[^0-9.]//g')
echo "$TS $TEMP"
sleep 1
done