I often set up Raspberry Pis. I always like to make sure a new Pi on my network runs the latest version of the OS. I had a regular problem in that I wanted to set up a Pi quickly, but ended up having to go to the website, check for latest version, and download that before I could start writing the card image.
Thankfully, the Raspberry Pi website always has the latest version of Raspbian, and always at the same URL which directs to the latest version. So, being very lazy, I wrote this script.
The script should be put in a directory on a Linux box and called from Cron. When the script is run it connects to raspberrypi.org to determine when the latest version of Raspbian was released. If you have a file in the current directory with that date in the filename, it exits cleanly and does nothing. If you don’t, it downloads the console-only and desktop versions of the latest release and unzips them for you. So the next time you need to set up a Pi, simply look in this directory and you’ll always have the latest version already downloaded.