TringaliLuca

Turn on and off GPIO pin on Raspberry with gmail

Apr 21st, 2017
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.22 KB | None | 0 0
  1. #!/bin/bash
  2. pin=7
  3. command=$(curl -u username:password --silent "https://mail.google.com/mail/feed/atom" |  grep -Po '(?<=(<summary>)).*' | sed 's/<\/summary>.*//'
  4.  
  5. if [ -n "$command" ]; then
  6.     gpio write $pin $command
  7. fi
Add Comment
Please, Sign In to add comment