Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 32 lines (23 sloc) 0.678 kB
#!/bin/bash
#name="name"
#pass="pass"
echo "Please set the name and pass."; exit 1
count=0
mails="$(wget --secure-protocol=TLSv1 --timeout=3 -t 1 -q -O - \
https://${name}:${pass}@mail.google.com/mail/feed/atom \
--no-check-certificate)"
if [ -z "$mails" ]
then
notify-send "Mails Check Error"
exit 1
fi
mails="$(echo "$mails" | egrep 'fullcount|title' \
|sed -e '2,$s/.*<fullcount>//' -e '2,$s/<\/fullcount>//' \
-e '2,$s/.*<title>//' -e '2,$s/<\/title>//' |sed -n '2,$p' )"
count="$(echo "$mails" | sed -n '1p')"
mails="$(echo "$mails" | sed -e '2,$s/^/\* /' | sed -n '2,$p')"
if [ "$count" -gt "0" ]
then
notify-send "Get $count new mails" "$mails"
fi
exit 0
Jump to Line
Something went wrong with that request. Please try again.