Run preset commands on a linux computer via text message
###Introduction###
This project works thanks to IFTTT and Dropbox. IFTTT receives a text and syncs it to the computer via Dropbox. Then a script will check for the existence of the file and if it is there, run a command.
###Implementation###
####Dropbox####
- You will need to create an account if you haven't already.
- Dropbox can be downloaded from https://www.dropbox.com/install
- See the Dropbox Wiki for configuring Dropbox to run at startup
####IFTTT####
- Create an account if you haven't already
- Go to https://ifttt.com/recipes/85666 activate the Dropbox and SMS channels if they aren't already, customize as needed, then click "Use Recipe"
####Script####
- Download the script
iftttcontrol.sh
from this repository - Edit the variables at the beginning of the file for the IFTTT folder location and where you want a log to be stored
- Edit the command variables if you are using different IFTTT text tags
- You may want to move the script to a safe location and change the owner to root so it can't be edited too easily
####Cron####
- Since commands such as
shutdown
require root, I used the crontab at /etc/crontab to do so - This is the line that I entered in crontab to run the script every minute, where "
/etc/ifttt/iftttcontrol.sh
" is the location of the script, it may be different for you:
*/1 * * * * root sh /etc/ifttt/iftttcontrol.sh
###Pushover Notifications###
If you would like to receive Pushover notifications, use the iftttcontrolnotify.sh file instead of the iftttcontrol.sh file. Be sure to set the POTOKEN and POUSER variables.