aboutsummaryrefslogtreecommitdiff
path: root/misc/email/checkmail
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-01-13 17:32:58 -0200
committerSilvio Rhatto <rhatto@riseup.net>2013-01-13 17:32:58 -0200
commita64487d5db57b9e281a5953b082618d2c1fca8a4 (patch)
treebfd1f26e5eaccf9cfd3d2809a49161beceb7f9b6 /misc/email/checkmail
parentf6978c1b28db3308808f2e303c607047f97a96c5 (diff)
downloadscripts-a64487d5db57b9e281a5953b082618d2c1fca8a4.tar.gz
scripts-a64487d5db57b9e281a5953b082618d2c1fca8a4.tar.bz2
Removing old scripts and cleaning up some code
Diffstat (limited to 'misc/email/checkmail')
-rwxr-xr-xmisc/email/checkmail14
1 files changed, 14 insertions, 0 deletions
diff --git a/misc/email/checkmail b/misc/email/checkmail
new file mode 100755
index 0000000..078f111
--- /dev/null
+++ b/misc/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