diff options
Diffstat (limited to 'checkmail')
-rwxr-xr-x | checkmail | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/checkmail b/checkmail new file mode 100755 index 0000000..078f111 --- /dev/null +++ b/checkmail @@ -0,0 +1,14 @@ +#!/bin/bash +# +# Simple mail counter +# Inspired by http://www.vivaolinux.com.br/dicas/verDica.php?codigo=2432 +# + +# Fetch and compute +FETCH=`fetchmail -c` +TOTAL=`echo $FETCH | awk '{ print $1 }'` +SEEN=`echo $FETCH | awk '{ print $3 }' | sed -e 's/(//'` +NEW=`echo "$TOTAL - $SEEN" | bc` + +# Display response +echo $NEW/$TOTAL |