Show your Raspi temperature

RasPi

I just found a script to display the temperature under your Raspi terminal. If you are interested...



#!/bin/bash
# Script to show the temperature of the Raspberry Pi in terminal
# Values can be adjusted to show different color temperatures.
# By default:
#      40 degrees or less -> green (32)
#      Between 41 and 54 -> yellow (33)
#      Greater than or equal to 55 -> red (31)

mgrados='cat /sys/class/thermal/thermal_zone0/temp'
engrados='expr $mgrados / 1000'

if [ $engrados -le 40 ]; then
    echo -e "Temp CPU:\033[32m $engrados"
elif [ $engrados -gt 40 ] && [ $engrados -lt 55 ]; then
    echo -e "Temp CPU:\033[33m $engrados"
else
    echo -e "Temp CPU:\033[31m $engrados"
fi


I request your permission to obtain statistical data on its navigation on this website. If you continue to browse I consider you accept the use of cookies. This site is adapted to be compliant with the new law about General Data Protection Regulation. OK | More Information