#!/bin/sh
#
#TinTin++
#Copyright (C) 2001 Davin Chan, Robert Ellsworth, etc. (See CREDITS file)
#
#This program is protected under the GNU GPL (See COPYING)
#
#    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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
# Send email to the tintin++ development team: use this for
# bug reports, questions, pleas for help, or anything, really.
#

# Our email address -- hopefully this won't change too soon.
DEVTEAM=scandum@hotmail.com

# Warnings about non-distribution versions.
# WARNING='NOTE!!  This is a *development* version, so may be very buggy!'
# SUBJECT='A tintin++ gripe (DEV)'

echo "Please use the forum (linked to from the tintin++ site) to report bugs :)"

exit 0

WARNING=''
SUBJECT='A tintin++ gripe'

TMP=/tmp/gripe.$$
FORMFEED=""

cat <<EOF
Please type your question, complaint, or comment now.
To send your message, type control-D alone on a line
after you are finished.

What you type now will be emailed to the development team;
so please read the documentation BEFORE mailing us!

Please type control-C now if you don't want to send us any email.
Don't spam us with unnecessary email.. please...
$WARNING
EOF

cat - >$TMP

echo 'Are you sure you want to send this message?'
read yesno
case "$yesno" in
y*|Y*)	;;
*)	echo Ok, not sending.; exit 1;;
esac

# Get some extra information the sender might forget to include.

echo " "			>>$TMP
echo "$FORMFEED"		>>$TMP
echo " "			>>$TMP
echo "This is a program-generated gripe.  Output follows:"	>>$TMP
echo " "			>>$TMP
uname -a			>>$TMP
echo "$FORMFEED"		>>$TMP
grep Version src/tintin.h	>>$TMP
echo "$FORMFEED"		>>$TMP
cat /etc/motd			>>$TMP
echo "$FORMFEED"		>>$TMP
ls -C				>>$TMP
echo "$FORMFEED"		>>$TMP
# Just send the configurable section of the Makefile
cat src/Makefile		>>$TMP

# Send the email and be done with it already!

mail -s "$SUBJECT" $DEVTEAM <$TMP
rm -f $TMP

cat <<EOF

We'll try to answer your email as soon as possible.
-- The tintin++ development team.
EOF

exit 0
