Raspberry Pi Scripts

Here is a collection of Raspberry Pi scripts that I’ve put together over the past few months to make running and recovery easier and things just generally a little brighter when using ssh on my Raspberry Pi.

Raspberry Pi Scripts - after all, there\'s more than one type of Raspberry...


My Raspberry Pi scripts

Make no bones about it – the Raspberry Pi scripts here are by no means advanced, but they work without errors and help things keep running smoothly.

That said, I like ’em.

Initialisation script

Bar far the handiest of my Raspberry Pi scripts – initialise.sh.

This script is saved in your user’s home directory as initialise.sh and I run it after a reboot or power outage.

I used to have problems with my Owncloud installation as the disk is a USB key and it was having trouble mounting properly so I started with that and built it up from there.

The script does the following (in order):

  • Start a VNC server with a screen size of 1024×768 in 24bit colour depth and 96dpi.
  • unmount, mount and check the HFS+ filesystem of my USB key
  • restart Apache to allow Owncloud to run properly.

After a restart, that gets everything running smoothly again.  As I said – handy.

This script will look like this when run:

Sets you up for the day...
Sets you up for the day…


This script replaces the .bash_profile in your user’s home folder.  When it come to Raspberry Pi scripts, the MOTD is the one you will see most often (Especially if you’ve figured out cron!) so it’s a good idea to make it useful.  Pretty also helps.

Whenever you log on the your Raspberry Pi using SSH (or when your not using graphical mode), .bash_profile runs by default and the message displayed above the user prompt.


When run, it should look a little like this:

What the MOTD Script looks like when run.
What the MOTD Script looks like when run.

So there you have it – a wee collection of Raspberry Pi scripts which I find useful.