#!/bin/csh -f
# SCCSid "@(#)newuser 2.9 7/29/97 LBL"
#
# Script to get new user information.
#
set nonomatch
set mail=mail
if ( -x /usr/*/Mail || -x /*/Mail ) set mail=Mail
set ms=1
set tfile=/tmp/m$$
if ( ! $?EDITOR ) then
	setenv EDITOR vi
endif
onintr quit
cat <<_EOF_

This script asks some basic user information that will be mailed
back to headquarters.  Your name and address will be added to a
database of people using RADIANCE, so that software update and workshop
information can be sent to you directly (if you desire).

Please enter your name and regular mail address (followed by ^D):
_EOF_
echo \~s New `cat src/rt/VERSION` user >$tfile
echo "Regular mail address:" >>$tfile
sed 's/^/	/' >>$tfile
echo -n 'Phone number: '
echo "Phone: $<" >>$tfile
echo -n 'Permanent electronic mail address: '
echo "E-mail: $<" >>$tfile
echo -n 'Do you wish to subscribe to our moderated mailing list? '
echo "Add to mailing list: $<" >>$tfile
echo -n 'Do you wish to subscribe to our unmoderated discussion group? '
echo "Add to discussion group: $<" >>$tfile
echo -n 'Machine Type(s): '
echo "Machine: $<" >>$tfile
echo -n 'Operating system(s): '
echo "System: $<" >>$tfile
echo -n 'Where did you hear about Radiance? '
echo "Source: $<" >>$tfile
echo 'Application area/comments (followed by ^D):'
echo "Application:" >>$tfile
sed 's/^/	/' >>$tfile
echo "<EOT>"
echo ""
cat $tfile
echo ""
echo -n "Would you like to edit this information? "
if ( "$<" =~ [yY]* ) then
	$EDITOR $tfile
endif
echo "...sending mail to radiance-request@radsite.lbl.gov"
$mail radiance@radsite.lbl.gov <$tfile
set ms=$status

quit:
rm -f $tfile
exit $ms
