diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2014-09-18 16:38:01 -0300 |
---|---|---|
committer | Silvio Rhatto <user@example.org> | 2014-09-18 16:38:01 -0300 |
commit | f32ec8c49226dc860c38a2c36d7587d1d27419b8 (patch) | |
tree | 838eb53acda78197891e29b932aa1494bab249a1 /email/checkmail | |
download | utils-mail-f32ec8c49226dc860c38a2c36d7587d1d27419b8.tar.gz utils-mail-f32ec8c49226dc860c38a2c36d7587d1d27419b8.tar.bz2 |
Initial import
Diffstat (limited to 'email/checkmail')
-rwxr-xr-x | email/checkmail | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/email/checkmail b/email/checkmail new file mode 100755 index 0000000..078f111 --- /dev/null +++ b/email/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 |