Skip to content

Instantly share code, notes, and snippets.

@hitesh83
Last active May 24, 2017 10:04
Show Gist options
  • Save hitesh83/db05010db40e547f1a6fd8d02fee55e3 to your computer and use it in GitHub Desktop.
Save hitesh83/db05010db40e547f1a6fd8d02fee55e3 to your computer and use it in GitHub Desktop.
Pi info in mail with ScreenShot (bash)
#!/bin/bash
(echo "Current Date & time" && date && echo && echo Serial Number && sed -n '/^Serial/{s/.* //;p}' /proc/cpuinfo && echo && echo "Uptime at" && uptime && echo && free | grep Mem | awk '{print "Free RAM in MB= "$4/$2 * 100.0}' && echo && /opt/vc/bin/vcgencmd measure_temp && echo && echo CPU Freq && cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq && echo && echo "Files in Playlist" && ls ) > file.tmp
/usr/local/bin/raspi2png -p "/home/pi/Pictures/screen.png"
if [ -s file.tmp ]
then
mutt -s "ADD SUBJECT HERE" -a "/home/pi/Pictures/screen.png" -- xyzabc@gmail.com <file.tmp
fi
rm file.tmp
rm /home/pi/Pictures/*.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment