#!/bin/bash
MAILCOUNT=`curl -u gmailusername:gmailpwd --silent "https://mail.google.com/mail/feed/atom" | grep "<fullcount>.*</fullcount>"|sed 's/<fullcount>//g'|sed 's/</fullcount>//g'`
if (( $MAILCOUNT > 0 )); then
echo "You've got mail"
fi
MAILCOUNT=`curl -u gmailusername:gmailpwd --silent "https://mail.google.com/mail/feed/atom" | grep "<fullcount>.*</fullcount>"|sed 's/<fullcount>//g'|sed 's/</fullcount>//g'`
if (( $MAILCOUNT > 0 )); then
echo "You've got mail"
fi