TringaliLuca

Turn on and off GPIO pin on Raspberry with gmail

Apr 21st, 2017
83
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data