Step 4: Shell Script

This is the part that runs on your Raspberry Pi checking for the values in the MySQL Database.

This script is pretty simple, but does require setting up.

Firstly, download the script by inputting the commands below (on your Raspberry Pi).
sudo -i and hit Return / Enter.
wget and hit Return / Enter.

Once this has downloaded, type in the following:
chmod +x and hit Return / Enter.
nano and hit Return / Enter.

This will allow you to edit the script.
You must change the following variables at the top of the file:

mysqlusername="USERNAME HERE"
mysqlpassword="PASSWORD HERE"

These must be changed to the username and password you created previously in phpMyAdmin.

Once these have been changed, hold the Ctrl key and press x, then release the Ctrl key and press y, then hit Return / Enter.

That's it for the shell scripting session.
Remove these adsRemove these ads by Signing Up
richiep2 years ago
Should we store this script in the /www/directory?
Nice tutorial but the link.: dos not exist anymore.
Do you have a new link for it?