#!/bin/sh
#

address=mbase-request@internode.com.au

echo
echo "MetalBase 5.1 is now installed."
echo
echo "Note that this is a shareware package; if you plan to keep it, you should"
echo "make a contribution to the author.  See the chapter on registration in"
echo "the documentation directory for more information."
echo
echo "There is a MetalBase mailing list set up to keep you informed of bugs and"
echo "interesting applications, and upcoming new releases of MetalBase.  If"
echo "you wish to subscribe, enter 'y' below and mail will be sent to"
echo "$address to add you to the list."
echo
echo "If you have already installed a previous version of MetalBase, you may"
echo "be on the subscription list already--wait for a week, and if you do not"
echo "receive any mail from the mailing list, re-run this script."
echo
echo -n "Shall I add you to the MetalBase mailing list? [yN] "
ans=x
while [ ":$ans" != ":yes" -a ":$ans" != ":no" ]
do
   read ans
   if [ ":$ans" = ":Y" -o ":$ans" = ":y" ]; then
      ans="yes"
   fi
   if [ ":$ans" = ":N" -o ":$ans" = ":n" -o ":$ans" = ":" ]; then
      ans="no"
   fi
done

if [ ":$ans" = ":no" ]
then
   echo
   echo "No mail sent--enjoy the package."
   exit
fi

echo
echo "Thank you.  Please type in the email address where you would like"
echo "the mailing list to contact you, or enter 'q' to abort..."

ans="n"
while [ ":$ans" != ":y" ]
do
   echo
   echo -n ": "
   read addr
   echo
   if [ ":$addr" = ":q" -o ":$addr" = ":Q" ]; then
      echo "aborted.  Re-run this script later if you like."
      exit
   fi

   echo -n "Is '$addr' your correct address ?"
   read ans
done

if [ -r /usr/ucb/mail ]
then
   /usr/ucb/mail -s "Please add $addr" $address << END

REQ:     Add
USER:    $addr
VERSION: 5.1

END
else
   mail $address << END

REQ:     Add
USER:    $addr
VERSION: 5.1

END
fi

echo
echo "Mail sent.  Enjoy the package."

