#!/bin/ksh
#**********************************************************************#
#*                                                                    *#
#* Copyright (c) 2001 by Sun Microsystems, Inc.                       *#
#* All rights reserved.                                               *#
#*                                                                    *#
#**********************************************************************#


SUPPORT_ADDR=./.kxsupp_addr
if [ ! -f $SUPPORT_ADDR ]
then
  exit 0
fi

PACKAGETYPE=$1; export PACKAGETYPE
PATH=.:/usr/bin:/bin:/usr/ccs/bin:$PATH; export PATH
KIXEMAIL=/tmp/kixemail.$$; export KIXEMAIL

case $PACKAGETYPE in
  MTP) PACKAGENAME="Sun MTP package"
       VERSIONNUM=`cat $UNIKIX/VERSION | grep "^\""`
       VERSION="Sun MTP:	$VERSIONNUM"
         ;;
  MBM|batch) PACKAGENAME="Sun MBM package"
       VERSION=`./pack/bin/batchelp -v | cut -f2 -d':'`
         ;;
    *) exit 0;;
esac

cat > $KIXEMAIL << !

This is to notify Sun technical support group that 
the $PACKAGENAME has been installed.

Please forward this message to the Sun technical support group
using fax ( 602-995-6422 ) or e-mail 
          ( mtp_support@sun.com for Sun MTP)
          ( mbm_support@sun.com for Sun MBM).

    `echo $VERSION`

    Date:	`date`

    Host:	`uname -a`
 
    Owner:	`id | cut -f2 -d'(' | cut -f1 -d')'`


!

mailx `cat $SUPPORT_ADDR` >$DEVNULL 2>&1 << !
~s $PACKAGENAME installation

This is to notify Sun technical support group that 
the $PACKAGENAME has been installed.

Please forward this message to the Sun technical support group
using fax ( 602-995-6422 ) or e-mail
          ( mtp_support@sun.com for Sun MTP)
          ( mbm_support@sun.com for Sun MBM).

    `echo $VERSION`

    Date:	`date`

    Host:	`uname -a`
 
    Owner:	`id | cut -f2 -d'(' | cut -f1 -d')'`


!

if [ $? -eq 0 ]
then
  rm -f $SUPPORT_ADDR > $DEVNULL 2>&1
  echo ""
  echo "As part of the installation of these products, a message will be sent"
  echo "via email to the Sun technical support group. This is merely an"
  echo "informational message to notify us of an initial installation."
  echo ""
  echo "Press Return to Continue"
  read risp
fi

rm -f $KIXEMAIL
exit 0
