echo "If the  modem is conected, pleas unplug it now! "
echo "Enter to go ahead....."
read teste
echo "If the  modem is not conected, pleas plug it now! "
read teste
echo "Enter to go ahead....."
clear
echo "Read the output, I am going to call  lsub and  dmesg "
echo "making a pause between each call and have to see "
echo "the  phrase \" Huawei Technologies Co., Ltd. E620 USB Modem\ "
echo "or \"Product: HUAWEI Mobile \"  "
echo "in each of the output. "
echo "Enter to go ahead....."
read teste
echo "Using   lsub "
lsusb 
echo "Enter to go ahead....."
read teste
echo "Using   dmesg "
sudo cat /var/log/messages | grep  HUAWEI | more 
echo "Enter to go ahead....."
read teste
clear
echo "I am going to configure  wvdial, but I need your help to put the right device at \"/etc/wvdial.conf \" "
echo " \"/etc/wvdial.conf \" which must be one of these " 
echo " /dev/ttySL0  or  /dev/ttyUSB0   "
echo "but the final number may be anything like  0,1,2,3 "
echo "We'll have this information from the configuration of wvdial which will be run now. "
echo "After runing  wvdialconf  I'll edit  \"/etc/wvdial.conf \" using joe  "

echo "para que você corrija, manualmente, a posição do modem. "
echo "Leu ?  "
echo "Enter to go ahead....."
read teste
echo "Por favor leia novamente, vou apagar as instruções."
echo "e vou rodar wvdialconf "
echo "Leu ?  "
echo "Enter to go ahead....."
read teste

echo "Please, if you do not have \"joe\", stop now and edit this file puting the editor   "
echo "you use for ascii files - pure text - in place of joe. Use CTRL-C to stop this "
echo "script now, if this is the case.  Then run the script again! "
echo "Have you read this ?  about joe ? "
echo "Enter to go ahead..... or   CTRL-C to stop this script "
echo "Of course, if you are good bash programmer you may put here a function to read the"
echo "name of your editor.....and then send the improved file back to me."
read teste


clear
sudo wvdialconf
echo "Write down the position of the modem, it is at the end of the output of wvdialconf  "
echo "highlight with mose and copy to paste  .... "
echo "Have you read it ?  "
echo "Enter to go ahead....."
read teste
echo "Editing the configuration file for  wvdial "
echo "Enter to go ahead....."
read teste
sudo joe /etc/wvdial.conf.back
sudo cp /etc/wvdial.conf.back /etc/wvdial.conf
sudo wvdial



echo "runing wvdial "

