Subject: Re: Neat feature.
To: Peter Seebach <seebs@plethora.net>
From: Andrew Gillham <gillhaa@ghost.whirlpool.com>
List: current-users
Date: 06/15/2000 11:59:29
Peter Seebach writes:
> Proposed cool feature, found in BSD/OS:
>
> On the way up, the system diffs dmesg.boot with the "current" dmesg
> output, right before storing the new dmesg.boot.
>
> This is a feature I often miss when playing with configurations.
I posted something like this a few years back. Didn't get a lot of
interest. :(
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
#
# end-of-file
#
-Andrew
--
-----------------------------------------------------------------
Andrew Gillham | NetBSD ist Affengeil.
gillham@whirlpool.com | Nachts ist es kaelter
I speak for myself, not for my employer. | als draussen.