#!/bin/sh
#-----------------------------------------------------------------------
#;  Copyright (C) 1995-1998, 2000, 2004
#;  Associated Universities, Inc. Washington DC, USA.
#;
#;  This program is free software; you can redistribute it and/or
#;  modify it under the terms of the GNU General Public License as
#;  published by the Free Software Foundation; either version 2 of
#;  the License, or (at your option) any later version.
#;
#;  This program is distributed in the hope that it will be useful,
#;  but WITHOUT ANY WARRANTY; without even the implied warranty of
#;  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#;  GNU General Public License for more details.
#;
#;  You should have received a copy of the GNU General Public
#;  License along with this program; if not, write to the Free
#;  Software Foundation, Inc., 675 Massachusetts Ave, Cambridge,
#;  MA 02139, USA.
#;
#;  Correspondence concerning AIPS should be addressed as follows:
#;         Internet email: aipsmail@nrao.edu.
#;         Postal address: AIPS Project Office
#;                         National Radio Astronomy Observatory
#;                         520 Edgemont Road
#;                         Charlottesville, VA 22903-2475 USA
#-----------------------------------------------------------------------
# REGISTER - register yer copy of AIPS!
cat <<!
 This is the Astronomical Image Processing System -- AIPS
 Copyright (C) 2000 Associated Universities, Inc. Washington DC, USA.

 This program is free software; you can redistribute it and/or modify it
 under the terms of the GNU General Public License as published by the
 Free Software Foundation; either version 2 of the License, or (at your
 option) any later version.

 This program is distributed in the hope that it will be useful, but
 WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 General Public License for more details.

 You should have received a copy of the GNU General Public License along
 with this program; if not, write to the Free Software Foundation, Inc.,
 675 Massachusetts Ave, Cambridge, MA 02139, USA.

 Correspondence concerning AIPS should be addressed as follows:
 Email: aipsmail@nrao.edu   Postal: AIPS Project Office
                                    National Radio Astronomy Observatory
                                    520 Edgemont Road
                                    Charlottesville, VA 22903-2475, USA
!
echo "Press RETURN to continue..."; read dum
cat <<!
 - - - - - - - - - - - - DISCLAIMER!  READ THIS! - - - - - - - - - - - -

While this software is free, we do ask that you register your copy of
AIPS with us, if you want any NRAO-provided user support.  Unregistered
sites will not receive any user support from NRAO via email, phone, or
other methods.  Also, your registering will help us keep tabs on how
widespread AIPS actually is, what machines it's being used on, and so on
which will help us serve the Astronomical Community better.  It will
also give us the information we need to plan support/development levels,
much like the AIPS site surveys of the late 1980's did.

NRAO will offer support for registered AIPS sites on a "best effort"
basis if you need help with installation or operation of the software.
This means we will do our best to help you within our resources, but
there is NO guarantee.  The support is free for academic/educational or
similar users, but you can only get it if you have registered your copy
of AIPS.

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
!
if [ "$VERS" = "" ] ; then
   if [ "$AIPS_VERSION" = "" ] ; then
      echo "Neither VERS (from INSTEP1) nor AIPS_VERSION are defined."
      echo "Please define your AIPS environment by calling either"
      echo
      case "$SHELL" in
         *csh) echo "       source LOGIN.CSH";;
         *)    echo "       . LOGIN.SH";;
      esac
      echo
      echo "from the AIPS_ROOT area.  Then call this script again."
      exit 1
   else
      VERS=`echo $AIPS_VERSION | awk -F/ '{print $NF}'`
      case "$VERS" in
	 [0-9][0-9][A-Z][A-Z][A-Z][0-9][0-9]) ;;
         *) echo "Cannot understand AIPS_VERSION=$AIPS_VERSION"
	     echo "Something is WRONG!"
	     exit 1;;
      esac	
   fi
fi
case "$VERS" in
   [0-9][0-9][A-Z][A-Z][A-Z][0-9][0-9]) ;;
   *) echo "Version seems weird: $VERS"
      echo "Something is WRONG!"
      exit 1;;
esac	
echo "This script will now ask you several questions so that an AIPS"
echo "Registration Form can be filled in.  If possible, it will be sent"
echo "back to NRAO automatically via email.  This if for AIPS $VERS."
echo " "

AIPSHOST=`uname -n`
while [ "$AIPSHOST" = "" ] ; do
   echo "Please enter the name of this computer on the next line:"
   read AIPSHOST
done

if [ "$AIPS_ROOT" = "" ] ; then
   for i in 15[A-Z][A-Z][A-Z][0-9][0-9]/HELP ; do
      if [ -d $i ] ; then
         AIPS_ROOT=`pwd`
         break
      fi
   done
   if [ "$AIPS_ROOT" = "" ] ; then
      echo "I cannot find your AIPS 'root' area; it's not here (`pwd`)"
      echo "Please either enter what it should be, or just press RETURN"
      echo "to exit so you can move there and restart"
      read AIPS_ROOT
      [ "$AIPS_ROOT" = "" ] && exit 42
      if [ ! -d $AIPS_ROOT ] ; then
         echo "$AIPS_ROOT is not a directory, cannot proceed!"
         exit 42
      fi
   fi
fi

REGFIL=$AIPS_ROOT/REGISTER.INFO
if [ -s $REGFIL ] ; then
   echo "Found existing registration, reading name/address info..."
   echo "(moving old registration to ${REGFIL}.OLD)"
   . $REGFIL; mv $REGFIL ${REGFIL}.OLD; touch $REGFIL
   if [ "$AIPSVER" = "$VERS" ] ; then
      echo "Resuming or re-trying registration for $VERS"
   else
      echo "Old registration info was for $AIPSVER, this is $VERS"
      echo "so you do need to re-register.  Most of the information"
      echo "should not have to be re-entered.  I hope."
   fi
else
   echo "Using file $REGFIL (to store your answers)"
   touch $REGFIL
fi
#                                       Here is where things start
echo "AIPSVER=$VERS" >>$REGFIL
echo "AIPSDATE=\"`date`\"" >>$REGFIL
if [ "$INSTNAME" = "" ] ; then
   while [ "$INSTNAME" = "" ] ; do
      echo \
       "Enter your Institution's name (e.g. Astronomy Dept, FOO Univ.)?"
      read INSTNAME
   done
   echo "INSTNAME=\"$INSTNAME\"" >>$REGFIL
else
   echo "Institution name: $INSTNAME"
   echo "Enter new name or RETURN if no change desired"
   chg=""; read chg
   if [ "$chg" != "" ] ; then
      INSTNAME="$chg"
      echo "INSTNAME=\"$chg\"" >>$REGFIL
   else
      echo "INSTNAME=\"$INSTNAME\"" >>$REGFIL
   fi
fi

if [ "$INSTADDR1" = "" ] ; then
   n=0
   INSTADDR="foo"
   echo "Enter your address on the next lines, end with a blank line:"
   while [ "$INSTADDR" != "" ] ; do
      read INSTADDR
      case "$INSTADDR" in
	 "") ;;
	 *) n=`expr $n + 1`
	    eval "INSTADDR$n=\"$INSTADDR\""
            echo "INSTADDR$n=\"$INSTADDR\"" >>$REGFIL
            ;;
      esac
   done
else
   echo "Institution Address: "
   end="no"; n=0
   while [ "$end" != "" ] ; do
      n=`expr $n + 1`
      end=\$INSTADDR$n
      end=`eval echo $end`
      if [ "$end" != "" ] ; then
         echo "                     $end"
         echo "INSTADDR$n=\"$end\"" >>$REGFIL
      fi
   done
   n=`expr $n - 1`
   echo "Do you wish to change this?"
   read yn
   case $yn in
      y*|Y*)
         echo "Enter address on following lines, blank line terminates"
         INSTADDR="foo"; n=0
         while [ "$INSTADDR" != "" ] ; do
            read INSTADDR
            case "$INSTADDR" in
               "") ;;
               *) n=`expr $n + 1`
                  eval "INSTADDR$n=\"$INSTADDR\""
                  echo "INSTADDR$n=\"$INSTADDR\"" >>$REGFIL
                  ;;
            esac
         done
         ;;
   esac
fi
if [ "$CONTACT" = "" ] ; then
   echo "Enter the name of the contact person (probably you): "
   while [ "$CONTACT" = "" ] ; do
      read CONTACT
   done
   echo "If this is a new person, please tell us who was the old"
   echo "contact; otherwise leave blank"
   read OLDCONTACT
else
   old=""
   [ "$OLDCONTACT" != "" ] && old=" (was $OLDCONTACT)"
   echo "Contact Person: $CONTACT $old"
   tmp="$CONTACT"
   echo "Enter new Contact Person or RETURN if no change desired"
   read chg
   if [ "$chg" != "" ] ; then
      CONTACT="$chg"
      echo "Use $tmp as Previous contact? " ; read yn
      yn=`echo $yn | tr '[a-z]' '[A-Z]' | awk '{print substr($1,1,1)}'`
      if [ "$yn" = "Y" ] ; then
         OLDCONTACT="$tmp"
      elif [ "$OLDCONTACT" = "" ] ; then
         echo "Enter old contact, RETURN if none"; read OLDCONTACT
      else
         echo "Enter old contact, RETURN to leave as $OLDCONTACT"
         read chg
         [ "$chg" != "" ] && OLDCONTACT="$chg"
      fi
   else
      if [ "$OLDCONTACT" != "" ] ; then
         chg=""
         echo "Enter old contact, RETURN to leave as $OLDCONTACT"
         read chg
         if [ "$chg" != "" ] ; then
            OLDCONTACT="$chg"
         fi
      fi
   fi
fi
echo "CONTACT=\"$CONTACT\"" >>$REGFIL
[ "$OLDCONTACT" != "" ] && echo "OLDCONTACT=\"$OLDCONTACT\"" >>$REGFIL

if [ "$PHONE" = "" ] ; then
   echo "Enter your Phone Number:"
   while [ "$PHONE" = "" ] ; do
      read PHONE
   done
else
   echo "Enter new phone number, or RETURN to leave as $PHONE"
   read chg
   [ "$chg" != "" ] && PHONE="$chg"
fi
echo "PHONE=\"$PHONE\"" >>$REGFIL

if [ "$FAX" = "" ] ; then
   echo "If you have a fax number, please enter it too (blank if none)"
   read FAX
else
   echo "Enter your fax number or RETURN to leave as $FAX"
   read chg
   [ "$chg" != "" ] && FAX="$chg"
fi
[ "$FAX" != "" ] && echo "FAX=\"$FAX\"" >>$REGFIL

if [ "$EMAIL" = "" ] ; then
   if [ "$LOGNAME" != "" ] ; then
      me=$LOGNAME
   else
      me=`whoami`
   fi
   PATH=$PATH:/usr/sbin:/usr/etc
   tmp=`uname -n`
   thishost=`nslookup $tmp | grep '^Name:' | awk '{print $2}'`
   defemail="$me@$thishost"
   echo "Default email address will be $defemail"
   echo "Enter <RETURN> if correct, correct if not, or NONE if you"
   echo "do not want to receive registration via email."
   read EMAIL
   [ "$EMAIL" = "" ] && EMAIL=$defemail
else
   echo "Enter your electronic mail address, <RETURN> if it is $EMAIL"
   read chg
   [ "$chg" != "" ] && EMAIL="$chg"
fi
[ "$EMAIL" != "" ] && echo "EMAIL=\"$EMAIL\"" >>$REGFIL

if [ "$REORDER" = "" ] ; then
  echo "Enter the name of any older version of AIPS (e.g. 15JAN95);"
  echo "if none just press RETURN.  (if many, use the most recent)"
  read REORDER
else
   echo "Enter your previous version of AIPS, RETURN if $REORDER"
   read chg
   [ "$chg" != "" ] && REORDER="$chg"
fi
[ "$REORDER" != "" ] && echo "REORDER=\"$REORDER\"" >>$REGFIL

hl="$AIPS_ROOT/HOSTS.LIST"
if [ "$SITE" = "" ] ; then
   if [ -f $hl ] ; then
      nsite=`grep '^+  ' $hl | awk '{print $4}' | sort | uniq | wc -l`
      nsite=`expr $nsite + 0`
      case $nsite in
         1) SITE=`grep '^+  ' $hl | awk '{print $4}' | head -n 1`;;
#                                       old tail grammar for Solaris
         2) SITE=`grep '^+  ' $hl | awk '{print $4}' | head -n 1`
            SITE2=`grep '^+  ' $hl | awk '{print $4}' | sort | uniq | \
             head -n 2 | tail -1`
            SITE="$SITE $SITE2";;
         *) SITE=""
      esac
   fi
fi
if [ "$SITE" = "" ] ; then
   echo "Please enter EXACTLY what you intend to call your site in the"
   echo "HOSTS.LIST file.  This has to be a single uppercase word, e.g."
   echo "at NRAO/Charlottesville we use NRAOCV as the site name."
   echo "(This and the first hosts info are necessary for registration)"
   read SITE
   if [ "$SITE" = "" ] ; then
      echo "Sorry, you have to enter a valid site name"; exit 42
   fi
   echo "If you intend on sharing this AIPS installation among both"
   echo "big-endian (sun, rs6000, hp, sgi, convex...) and little-endian"
   echo "(linux, ultrix, alpha) systems, you need a second SITE name"
   echo "for the opposite-endian-to-$ARCH systems.  Example, at NRAO/CV"
   echo "we use VCOARN (NRAOCV spelt backwards).   Please enter this"
   echo "now, or just press RETURN if this is irrelevant"
   read chg
   [ "$chg" != "" ] && SITE="$SITE $chg"
fi
FIRSTHOSTS=""
nsite=`echo $SITE | wc -w`
# get rid of spaces
nsite=`expr $nsite + 0`
case $nsite in
   0) echo "this cannot happen!";;
   1) ;;
   2) ;;
   *) echo "**********************************************************"
      echo "Warning: You should not normally need more than two sites."
      echo "The sites found were: $SITE"
      echo "**********************************************************"
      ;;
esac
for site in $SITE ; do
   if [ -f $hl ] ; then
      chg=`grep $site $hl | grep '^+  ' | head -n 1 | \
       awk '{print $2, $3}'`
   fi
   if [ "$chg" = "" ] ; then
      echo "For site $site, please enter the VERY FIRST host and its"
      echo "architecture, e.g. for an rs6000 named rhesus, 'RHESUS IBM'"
      read FIRSTHOSTS
      if [ "$FIRSTHOSTS" = "" ] ; then
         echo "Sorry, I cannot proceed.  You'll have to start over."
         exit 42
      fi
   else
      echo "Found $chg as first host (and ARCH) for $site in HOSTS.LIST"
      FIRSTHOSTS="$FIRSTHOSTS $chg"
   fi
done
echo "SITE=\"$SITE\"" >>$REGFIL
echo "FIRSTHOSTS=\"$FIRSTHOSTS\"" >>$REGFIL

ARCH=`uname -s`
ARCHALL=`uname -a`
case $ARCH in
   SunOS)
      case `uname -r` in
         5*|6*) case `uname -i` in
		   *Ultra*) AIPSARCH="SUL";;
		         *) AIPSARCH="SOL";;
		   esac;;
         4*) AIPSARCH="SUN4"; [ `arch` = "sun3" ] && AIPSARCH="SUN3"
            ;;
      esac
      ;;
   OSF1*)              AIPSARCH="ALPHA" ;;
   AIX*)               AIPSARCH="IBM" ;;
   IRIX*)              AIPSARCH="SGI" ;;
   HP-UX*)
       AIPSARCH=HP
       case `uname -r` in
          B.10*)
            case `uname -m` in
               */7[0-3]*) ;;
               */7[89]*) AIPSARCH=HP2;;
               *) echo "What sort of HP are you on???"
                  echo "(Model number `uname -m` unfamiliar)"
                  exit 1;;
            esac
            ;;
       esac
       ;;
   [Ll]inux*|[Ii][3-7]86)
      case `uname -m` in
         [Ii][3-7]86)  AIPSARCH="LINUX";;
         alpha)        AIPSARCH="AXLINUX" ;;
         *)            AIPSARCH="NEW:`uname -m`";;
      esac;;
   Convex*)            AIPSARCH="CVEX" ;;
   Ultrix*)            AIPSARCH="DEC" ;;
   *)                  AIPSARCH="NEW:$ARCH" ;;
esac
if [ "$ARCH" = "" ] ; then
   echo "Please specify the architecture, e.g. SunOS 5.6, Linux 2.0.34,"
   echo "etc. for the system on which you are installing AIPS."
   read ARCH
   [ "$ARCHALL" = "" ] && ARCHALL="uname -a did not work on this system"
fi
if [ -f $hl ] ; then
   num=`grep '^+  ' $hl | awk '{print $3}' | grep "$AIPSARCH" | wc -l`
fi
if [ "$num" = "" ] ; then
   num=1
else
   num=`expr $num + 0`
   echo "(I found $num hosts in your $hl file of type $AIPSARCH)"
fi
echo "Counting this system, how many systems of type $AIPSARCH will you"
echo "configure to run AIPS?  ($num)"
done=no
while [ $done = no ] ; do
   read NUM
   [ "$NUM" = "" ] && NUM=$num
   case $NUM in
      [0-9]*) done=yes; break;;
      *) echo "Please enter a number";;
   esac
done
echo "ARCH=\"$ARCH\"" >>$REGFIL
echo "AIPSARCH=\"$AIPSARCH\"" >>$REGFIL
echo "ARCHALL=\"$ARCHALL\"" >>$REGFIL
echo "NUM=\"$NUM\"" >>$REGFIL
echo "If you intend to run/install AIPS on systems other than $ARCH,"
echo "please enter the Type of machine, how many will run AIPS, and the"
echo "typical Operating System level for each, one per line."
echo " "
echo "Known types: ALLN ALPHA AXLINUX CVEX DEC HP HP2 IBM LINUX SGI SOL"
echo "             SUL SUN3 SUN4"
echo "(for Alliant, Alpha/OSF1, Alpha/Linux, Convex, Dec Ultrix,"
echo " HP 9000/7xx, IBM RS/6000, Intel/Linux, Silicon Graphics,"
echo " Solaris 2.x, SunOS 4 on sun3 or sparc)"
echo " "
echo "Examples: LINUX, 3, Linux 2.0.35"
echo "          SUL,   5, SunOS 5.6"
echo " "
echo "Press RETURN on a blank line when you are finished.  Thank you!"
echo " "
foo="..."
n=0
while [ "$foo" != "" ] ; do
   n=`expr $n + 1`
   read foo
   if [ "$foo" = "" ] ; then
      break
   else
      eval "OTHER$n=\"$foo\""
      echo "OTHER$n=\"$foo\"" >>$REGFIL
   fi
done
echo "The information you have just entered is now stored in the file"
echo "$REGFIL.  Should you wish to re-register, e.g."
echo "to reflect a new or changed system, you may rerun this script (by"
echo "\"cd $AIPS_ROOT; ./REGISTER\"), it will read the above file and"
echo "will ask which items to change (it does not yet handle the"
echo "architecture info)."
echo " "
echo "Please note: because this procedure asks for information on all"
echo "your systems (see above), you only need to use it ONCE for your"
echo "entire AIPS site.  You do not have to run it on each system!"
cat <<!

Thank you; it really helps NRAO to know what systems are out here, so we
can give appropriate attention to the right architectures for AIPS.  It
also helps us to justify allocations of staff, resources, etc. so we can
help the AIPS community.

Finally, as an incentive to register your AIPS site, you may request
copies of the following documents (gratis), and/or a tape with the DDT
(dirty dozen test) image/uv files, but only if you are serious about
using AIPS for scientific or research purposes.  For each document, just
enter YES if you wish a copy of it (and bear in mind that a hypertext
version on the web may be more up to date even after a few months).  A
new AIPSLETTER comes out about semi-annually at the same time as a new
AIPS release.  Enter YES for it only if you wish to be added to the
paper copy mailing list; we encourage that you obtain the document via
the web or other on-line means (e.g., ftp).  The current AIPSLetter is
always accessible from http://www.cv.nrao.edu/aips/ on the web.

!
echo "Paper copy of current AIPSletter: "
read yn
case $yn in
   Y*|y*) echo "AIPSLETTER=YES" >>$REGFIL;;
esac
echo "AIPS Cookbook (master version at http://www.cv.nrao.edu/aips/): "
read yn
case $yn in
   Y*|y*) echo "AIPSCOOK=YES" >>$REGFIL;;
esac
echo "(15APR90) Going AIPS [Programming in AIPS] Volume 1: "
read yn
case $yn in
   Y*|y*) echo "GOINAIP1=YES" >>$REGFIL;;
esac
echo "(15APR90) Going AIPS [Programming in AIPS] Volume 2: "
read yn
case $yn in
   Y*|y*) echo "GOINAIP2=YES" >>$REGFIL;;
esac
cat <<!

AIPS MEMOS (see list via anonymous ftp on aips.nrao.edu
[192.33.115.103], in /pub/aips/TEXT/PUBL/AIPSMEMO.LIST or via World-Wide
Web at http://www.cv.nrao.edu/aips/; most are also included in your copy
of AIPS in TEXT/PUBL/) Enter numbers of memos you would like in hardcopy
(check the list first and only choose ones you CANNOT print out
yourself!)
!
read AIPSMEMOS
[ "$AIPSMEMOS" != "" ] && echo "AIPSMEMOS=\"$AIPSMEMOS\"" >>$REGFIL
echo " "
echo "DDT tape (generated for 15JAN94), specify your preferred format"
echo "(valid formats are DAT, 9TRACK, EXB8200, EXB8500, QIC150)"
echo "DDT images are also available via anonymous ftp to aips.nrao.edu"
echo "and via the world wide web through http://www.cv.nrao.edu/aips/"
echo "Enter your format or RETURN for none"
read DDTFORMAT
[ "$DDTFORMAT" != "" ] && echo "DDTFORMAT=\"$DDTFORMAT\"" >>$REGFIL

cat <<!

We can unfortunately no longer offer custom binders.  We will shortly be
providing digital versions of the covers; this will enable you to
purchase appropriate binders elsewhere and still have the official
"AIPS" look.

!
BINDERS=""
#  echo "The Cookbook: "; read yn
#  case $yn in
#     Y*|y*) BINDERS="Cookbook ";;
#  esac
#  echo "Going AIPS Volume 1: "
#  read yn
#  case $yn in
#     Y*|y*) BINDERS="$BINDERS Going-AIPS-Vol-1 ";;
#  esac
#  echo "Going AIPS Volume 2: "
#  read yn
#  case $yn in
#     Y*|y*) BINDERS="$BINDERS Going-AIPS-Vol-2 ";;
#  esac
#  [ "$BINDERS" != "" ] && echo "BINDERS=\"$BINDERS\"" >>$REGFIL

# finally, mail the form

echo "Thank you for taking the time to fill this out."
sent=no
if [ "$REGSENT" != "" ] ; then
   vers=`echo $REGSENT | awk '{print $NF}'`
   if [ "$vers" = "$VERS" ] ; then
      UPDATE=""
      echo "You seem to have already sent this registration via email"
      echo "(on $REGSENT)"
      echo "so you should not have to re-send it (unless you are"
      echo " updating or changing information such as addresses or"
      echo " phone numbers, site information, number of systems...)"
      echo "Please enter YES if this is an update (you can include a"
      echo " comment after the \"YES\" on the same line if you like):"
      read UPDATE
      case $UPDATE in
	 y*|Y*) echo "UPDATE=\"$UPDATE (prior $REGSENT)\"" >>$REGFIL
		;;
      esac
   else
      echo "Your last registration seems to be with version $vers"
      echo "and as this is AIPS version $VERS, you should re-register."
   fi
fi
if [ "$EMAIL" != "" ] ; then
   echo "Enter YES on the next line to e-mail the registration form:"
   read yn; echo
   case $yn in
      y*|Y*)
         cat $REGFIL | grep -v '^REGSENT=' >${REGFIL}.tmp
         rm -f $REGFIL; mv ${REGFIL}.tmp $REGFIL
	 whoto="aipsmail@nrao.edu"
	 [ "$EMAIL" != "" ] && whoto="$whoto,$EMAIL"
         mail $whoto <$REGFIL
         if [ $? -eq 0 ] ; then
            echo "Sent!"; sent=yes
            echo "REGSENT=\"`date` for AIPS $VERS\"" >>$REGFIL
         else
            echo "That did not seem to work.  I tried the command"
            echo " "
            echo "    mail $whoto <$REGFIL"
            echo " "
            echo "If you know of another way to send file $REGFIL"
            echo "to aipsmail@nrao.edu on the internet, please do."
            echo "Otherwise, follow the instructions below."
         fi
         ;;
      *) echo "Registration form NOT sent!  Please bear in mind that"
         echo "NRAO cannot provide you with any technical support for"
	 echo "AIPS unless you register.  Also, registration helps us"
	 echo "gauge what systems our user community is using for AIPS."
	 echo " "
	 echo "If you change your mind, just re-run the REGISTER script"
	 echo "in $INSUNIX."
	 ;;
   esac
fi
if [ $sent = no ] ; then
   echo "Please print out the file $REGFIL and mail it to this address:"
   echo " "
   echo "          AIPS Project Office"
   echo "          National Radio Astronomy Observatory"
   echo "          520 Edgemont Road"
   echo "          Charlottesville, VA 22903-2475, USA"
   echo " "
   echo "or if you can, e-mail it to aipsmail@nrao.edu on internet."
   echo "When received, we will contact you with your registration keys"
fi
echo "End of Registration for AIPS"
