getting alerts about system upgrades

Karl Vogel vogelke at pobox.com
Thu Jun 1 10:43:47 PDT 2006


>> On Thu, 1 Jun 2006 12:54:24 +1200 (NZST), 
>> Andrew McNaughton <andrew at scoop.co.nz> said:

A> I do that, but my mailbox gets lots of traffic.  Sometimes I miss
A> something, and as far as I know, there's no system to keep reminding me,
A> nor a way to quickly check the current state of play.

   I have the same problem, so I run the script below hourly from cron to
   check my mailbox for anything I consider urgent.  It won't nag me
   repeatedly about the same messages, so it's not too intrusive.

   The file "$HOME/.whitelist-alert" holds patterns (one per line) for
   messages that should get immediate attention.  The patterns are mostly
   email addresses or words consistently found in subject lines.

   The "xnote" program is simply a driver for "xalarm", which displays an
   X-windows popup message.

-- 
Karl Vogel                      I don't speak for the USAF or my company
vogelke at pobox dot com                   http://www.pobox.com/~vogelke

The early bird still has to eat worms.

===========================================================================
#!/bin/sh
# look for important messages.

PATH=/bin:/usr/bin:/usr/local/bin
export PATH 
umask 077

# Any mail?

mbox="/var/mail/$USER"

if test -s "$mbox"
then
    old="$HOME/.priority"
    new="$HOME/.priority.n"
    fgrep -if $HOME/.whitelist-alert $mbox > $new

    # don't say anything unless we have new priority mail.
    if test -s "$new"
    then
        cmp -s $old $new || xnote "you have high-priority mail"
    fi
    mv $new $old
fi

exit 0



More information about the freebsd-questions mailing list