Added file exists sanity check

This commit is contained in:
Joshua Sherman 2014-01-27 10:53:48 -05:00
parent 84afbdf863
commit a7fb755ab4

View file

@ -16,11 +16,16 @@ function server()
function unread_email()
{
unread=( $(</tmp/UNREAD_GMAIL) )
file=/tmp/UNREAD_GMAIL
if [[ unread -ge 5 ]];
if [[ -a $file ]];
then
echo 📩
unread=( $(<${file}) )
if [[ unread -ge 5 ]];
then
echo 📩
fi
fi
}