Guest User

Gmail_check

a guest
Apr 12th, 2010
763
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. gmail_login="username"
  4. gmail_password="password"
  5.  
  6. nbmail="$(wget --secure-protocol=TLSv1 --timeout=3 -t 1 -q -O - \
  7. https://${gmail_login}:${gmail_password}@mail.google.com/mail/feed/atom \
  8. --no-check-certificate | grep 'fullcount' \
  9. | sed -e 's/.*<fullcount>//;s/<\/fullcount>.*//' 2>/dev/null)"
  10.  
  11. if [ -z "$nbmail" ]; then
  12. echo "Error"
  13. else
  14.     if [ $nbmail != 0 ]; then
  15. <------>echo "$nbmail message(s)"
  16.     else
  17. <------>echo "$nbmail message(s)"
  18.     fi
  19. fi
RAW Paste Data