Added file exists sanity check
This commit is contained in:
parent
84afbdf863
commit
a7fb755ab4
1 changed files with 8 additions and 3 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue