On Wed, 19 Feb 2003, Chuck Gelm wrote:

> Howdy, Y'all:
>
>  I'm monitoring my /var/log/messages file and I'd
> like to have the PC's speaker beep when there is a new
> entry.  I am monitoring 'DENY'ed packets.  I am now
> using 'cut' and 'grep' and 'tail' to show the last
> 11 denied packets.  How can I cause the PC speaker to
> beep when the last 11 lines are different the the
> previous 11 lines.
>
> Here is what I am using now:
>
> #!/bin/sh
> #
> grep DENY /var/log/messages > t
> cut -f2 -d\= t > u
> cut -f2 -d" " u > v
> cut -f1 -d: v > w

tail -n 11 w | diff -- - deny.txt >/dev/null 2>&1 || echo -ne "\a"

> tail -n 11 w > deny.txt
> clear
> echo ""
> cat deny.txt
> echo ""
> chmod 777 deny.txt   ; v
> chgrp users deny.txt ; so that my other workstations can see
>
> Regards, Chuck
> -
Lawson

--
---oops---



________________________________________________________________
Sign Up for Juno Platinum Internet Access Today
Only $9.95 per month!
Visit www.juno.com
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

Reply via email to