Subject: Re: Neat feature.
To: Andrew Gillham <gillhaa@ghost.whirlpool.com>
From: Simon Burge <simonb@netbsd.org>
List: current-users
Date: 06/16/2000 10:41:58
Peter Seebach wrote:

> In message <200006151559.LAA19262@ghost.whirlpool.com>, Andrew Gillham writes:
> >I posted something like this a few years back.  Didn't get a lot of
> >interest. :(
> 
> Amusingly, your sed script is within a small epsilon of the one BSD/OS uses.
> 
> >Here is what I have been using.
> >#!/bin/sh
> >#
> ># check for changes in the hardware configuration
> >#
> >if [ -f /var/log/dmesglog ]; then
> >        echo -n 'checking hardware config:'
> >        mv /var/log/dmesglog /var/log/dmesglog.0
> >        dmesg | sed -n '/^NetBSD/h; /^NetBSD/!H; ${ x; p; q; }' \
> >                > /var/log/dmesglog
> >        diff -bc /var/log/dmesglog.0 /var/log/dmesglog > /tmp/diff.$$
> >        if [ -s /tmp/diff.$$ ]; then
> >                cat /tmp/diff.$$ | Mail -s "hardware change" root
> >                echo ' changed.'
> >        else
> >                echo ' no change.'
> >        fi
> >        rm -f /tmp/diff.$$
> >fi

I wonder if the diff line should be:

	diff -bc -I^NetBSD ...

so that just a kernel recompile won't result in a "hardware change"
message.  Either that, or call it a "boot message change" message
instead...

Simon.