September 2016
Beginner to intermediate
593 pages
12h 12m
English
Now, obviously, we don't want to have to manually start the alarm control script each time the Raspberry Pi boots up, for example, after a power failure—for a start, we may not even be there. Therefore, we need to set up our operating system so that it will automatically start up the alarm-control.sh script at boot time.
To do this, we need to edit the rc.local file using Nano:
$ sudo nano /etc/rc.local
Before the line containing exit 0, insert the following line:
sudo /etc/pi-alarm/alarm-control.sh &
The & symbol at the end of the line is important because it will then make the script run in a different process, otherwise the rc.local script would never exit.
Your rc.local file should now look something like ...
Read now
Unlock full access