#!/bin/bash
clear
echo "This script needs to be ran while there is NO PPP connection "
echo "estabolished.  (probably no worry here because that is probably"
echo "the reason you are running this script :) ) It will attempt"
echo "a connection with debuging info turned on and then produce a file"
echo "that you will have to mail to me."
echo
echo "Hit <return> to continue or ^C to quit."
read


EMAIL=""
while [ "$EMAIL" = "" ]
do
   echo "What is your e-mail address?"
   read EMAIL
done

STARTPPP=""
while [ "$STARTPPP" = "" ]
do
   echo "What is the script you call to estabolish a ppp connection?"
   echo "*** the default was startppp"
   read STARTPPP
done

PPPPATH=/usr/sbin
if [ -f /usr/sbin/$STARTPPP ] 
then
   INITFILE=/usr/sbin/$STARTPPP
else
   while [ ! -f $PPPPATH/$STARTPPP ] 
   do
      echo "$PPPPATH didn't contain $STARTPPP"
      echo "What is the path leading up to $STARTPPP"
      read PPPPATH
   done
   INITFILE=$PPPPATH/$STARTPPP
fi
echo "$EMAIL" > ~/bmdial.error
cat $INITFILE >> ~/bmdial.error
echo
echo "If the script hangs for a LONG time here just hit ^C ONCE and "
echo "continue on with the instructions"
$INITFILE -d
grep -v ">> send" /tmp/.bmdial.debug >> ~/bmdial.error

echo
echo "*** NOTICE"
echo "Now take a look at ~/bmdial.error and make sure that the password"
echo "to your account is NOT in there among the data that looks like"
echo "C functions.  This script *SHOULD* have taken it out automatically"
echo "BUT I can't guarentee that."
echo
echo
echo "Done!!"
echo "Now mail ~/bmdial.error along with a brief description of the problem"
echo "to blkmajik@mcn.net and I will take a look at it and try to figure"
echo "out the problem and get a fix to you ASAP"



