diff -uNr misc/runreport.sh misc.foo/runreport.sh --- misc/runreport.sh Wed Dec 31 19:00:00 1969 +++ misc.foo/runreport.sh Tue Jan 29 10:10:52 2002 @@ -0,0 +1,46 @@ +#!/bin/sh + +#DEBUG=1 + +# Cerberus home +CHOME=/usr/bin/ctcs + +# Kernel versions, running, installing +KRUNNING=`uname -r` +KINSTALLING="$2" + +# Reporting directory +REPORT_FILE="/var/autoreportctcs/reports/$KVER" + +# Admins' email addresses, one per line +ADMINS_FILE="/var/autoreportctcs/configs/admins" + +# We need a report file, even if it's empty. +touch $REPORT_FILE + +[ $1 ] || { echo "No argument passed to runreport" ; exit 1 ; } + + +# Determine the type of notify event. +case "$1" in + + install-fail ) MESG="Kernel $KINSTALLING failed to install on " ;; + boot-fail ) MESG="Kernel $KINSTALLING failed to boot on " ;; + startup ) MESG="Autoctcs start up on " ;; + pre-kinstall ) MESG="Kernel $KINSTALLING starting installation on " ;; + post-kinstall ) MESG="Kernel $KINSTALLING installed on " ;; + testing ) MESG="Kernel $KINSTALLING testing start on " ;; + * ) MESG=" unknown message generated by " ;; + +esac + +# Mail admins + +MACH_NAME=`uname -n` +SUBJECT=`echo $MESG $MACH_NAME` + +while read ADMIN ; do + mail -s "$SUBJECT" "$ADMIN" < $REPORT_FILE +done < $ADMINS_FILE + +exit 0