Last active
August 14, 2017 01:47
-
-
Save piksel/4592633 to your computer and use it in GitHub Desktop.
overclocking status for the raspberry pi shell script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# ocstat - overclocking status for the raspberry pi | |
# | |
# relies on bc for calculations, if you get a command not found error, run: | |
# sudo apt-get install bc | |
# | |
echo -n " Freq: " | |
cat /boot/config.txt | grep _freq | tr -t '\n' ' ' | sed 's/_freq//g' | |
echo "" | |
echo -n " Overvolt: " | |
cat /boot/config.txt | grep over_voltage | tr -d 'over_voltage=' | |
echo -n "Temperature: " | |
echo -e "$(echo "scale=2;$(</sys/class/thermal/thermal_zone0/temp)/1000" | bc)\xc2\xb0C" | |
echo -n "CPU Scaling: " | |
echo "$(echo "scale=2;$(</sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq)/1000" | bc) MHz" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment