Skip to content

Instantly share code, notes, and snippets.

@un33k
Last active April 2, 2021 18:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save un33k/2c6fbfc8df88d45f7dcd2c199d5762e0 to your computer and use it in GitHub Desktop.
Save un33k/2c6fbfc8df88d45f7dcd2c199d5762e0 to your computer and use it in GitHub Desktop.
Raspberry Pi Status
#!/usr/bin/env bash
# AvidCaster.net
# #############################################################
# sysstat must be installed (e.g. sudo apt-get install sysstat)
echo "$(date) @ $(hostname)"
echo "-------------------------------------------"
while true
do
TEMP=$(vcgencmd measure_temp);
IDLE=$(sar 1 2 | grep "Average" | sed 's/^.* //')
printf "\r%s" "Idle CPU=$IDLE%, $TEMP ...";
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment