How to set programs as a startup program on the Raspberry Pi

To set a program as a startup program on the Raspberry Pi you need to log into the Raspberry Pi first and create a program like we did in the last Tutorial. And now I will show you how to get this program to start when you start your Raspberry Pi.

In order to open the start programs folder use this code snippet:

sudo nano /etc/rc.local

There you add some code that will open the player.sh file we created in the last Tutorial. This procedure will work with other programs as well. Make sure you add the following code between fi and exit 0 (and a free line above and under) at the last line of the file:

ADVICE: You can scroll down in the file by using the arrow keys.

sudo bash /home/pi/player.sh &

The file should look like this now:

This picture shows how the startup program folder of the Raspberry Pi looks like after adding a program to it

 

After this is written to the file you press Strg+x and the Raspberry will ask you if you want to save the modified buffer. You hit y and enter. Now you should be back in the command line.

Now you can simply turn off the Raspberry Pi by pulling the plug. Wait a few seconds and put it back again. After half a minute you should hear your internet radio again like you already did in the last Tutorial.

Jump on to the next Tutorial where you can bring your Raspberry Pi into your Home WLAN network!

Leave a Reply

Your email address will not be published.