Skip to content

Instantly share code, notes, and snippets.

@Egor3f
Created March 7, 2022 13:33
Show Gist options
  • Save Egor3f/ab6444505b600debabdb135ed0d65d0a to your computer and use it in GitHub Desktop.
Save Egor3f/ab6444505b600debabdb135ed0d65d0a to your computer and use it in GitHub Desktop.
Raspberry pi temperature
#!/bin/bash
while true; do
cur_second=`date +"%-S"`
if (( $cur_second == 0 )); then
minute=$cur_minute
echo -n $'\n'`date +"%d.%m.%y %H:%M"`:
elif (( $cur_second % 10 == 0 )); then
echo -n ' |'
fi
temp=`cat /sys/class/thermal/thermal_zone0/temp`
echo -n ' '${temp:0:2}
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment