#!/bin/sh # $Ximalas$ PATH=/bin:/sbin:/usr/bin DMESG_BASE=/tmp DMESG_OLD=${DMESG_BASE}/dmesg.old DMESG_NEW=${DMESG_BASE}/dmesg.new DMESG_DIFF=${DMESG_BASE}/dmesg.diff DIFF_PARAM="-u" RCPT=trond@localhost if [ ! -f ${DMESG_OLD} ]; then dmesg > ${DMESG_OLD}; fi dmesg > ${DMESG_NEW} if ! diff ${DIFF_PARAM} ${DMESG_OLD} ${DMESG_NEW} > ${DMESG_DIFF}; then mail -s "dmesg changed" ${RCPT} < ${DMESG_DIFF}; mv ${DMESG_NEW} ${DMESG_OLD}; fi exit 0