#!/bin/bash
# Created by Ben Okopnik on Mon Mar  7 08:49:20 EST 2005

# If 'MailTail' isn't already running, then...
[ -z "`pgrep -f MailTail`" ] && {
	# Create a named pipe
	mknod /tmp/.mailtail p > /dev/null 2>&1
	# Delete it when we exit this script
	trap 'rm /tmp/.mailtail' 0
	# "Watch" the mail.info file as it grows, send new data to the pipe
	tail -n 1 -f /var/log/mail.info > /tmp/.mailtail 2>/dev/null &
	# Launch the xterm, grep the above pipe for meaningful content
	xterm -fn nexus -bg black -fg yellow -geometry 48x4+1032+654 -T MailTail -name MailTail -e grep  'for ben at\|reading' /tmp/.mailtail
}

