#!/bin/sh
# $Id: mail.sh,v 1.2 1998/05/07 16:19:01 nathanw Exp $
# Send system configuration mail to a SIPB install log and possibly 
# to the user as well.

# /tmp/vars inputs:
#	revision	install.sh revision number
#	on_mitnet	whether the machine is on MITnet
#	rootmail	where to forward root mail
#	mail		whether to send configuration mail
#	mail_cc		where to cc configuration mail to
#	action		what to do after installing

. /tmp/vars

if [ "$mail" != "yes" ]; then
	exit 0
fi


echo -n "Mailing configuration info... "
(
cat << EOF
To: netbsd-install@mit.edu (NetBSD installation logger)
Cc: $mail_cc
From: netbsd-install@mit.edu (NetBSD installation pseudouser)
Subject: New NetBSD/i386 install

---------Parameters:-----------------------------------------------------
    Installation took place on MITnet:  $on_mitnet
    Root mail forwarded to:		$rootmail
    Action selected after install:	$action
    Version of install.sh:              $revision
---------mount output:---------------------------------------------------
`mount`
---------df output:------------------------------------------------------
`df -k`
---------Sysctl-based information:---------------------------------------
`sysctl kern hw`
---------dmesg output:---------------------------------------------------
`dmesg -N /tmp/netbsd 2> /dev/null`
---------ifconfig output:------------------------------------------------
`ifconfig -a`
-------------------------------------------------------------------------
EOF
) | sendmail -C /hd/etc/sendmail.cf -oQ/hd/var/spool/mqueue -t \
	-f netbsd-install@mit.edu
echo "done"
