dialog --backtitle "$BGTITLE" --title "ALSA-Info script v $SCRIPT_VERSION" --yesno "\nThis script will collect information about your ALSA installation and sound related hardware, to help diagnose your problem\n\nBy default, this script will AUTOMATICALLY UPLOAD your information to a $WWWSERVICE site.\n\nSee $0 --help for options\n\nDo you want to run this script?" 0 0
else
dialog --backtitle "$BGTITLE" --title "ALSA-Info script v $SCRIPT_VERSION" --yesno "\nThis script will collect information about your ALSA installation and sound related hardware, to help diagnose your problem\n\nSee $0 --help for options\n\nDo you want to run this script?" 0 0
fi
DIALOG_EXIT_CODE=$?
if [ $DIALOG_EXIT_CODE != 0 ]; then
echo "Thank you for using the ALSA-Info Script"
exit 0;
fi
else
echo "ALSA Information Script v $SCRIPT_VERSION"
echo "--------------------------------"
echo ""
echo "This script will collect information about your ALSA installation and sound related hardware, to help diagnose your problem."
echo ""
if [ -z "$NOUPLOAD" ]; then
if [[ -n "$TPUT" ]]; then
tput bold
echo "By default, the collected information will be AUTOMATICALLY uploaded to a $WWWSERVICE site."
echo "If you do not wish for this to occur, run the script with the --no-upload argument"
tput sgr0
else
echo "By default, the collected information will be AUTOMATICALLY uploaded to a $WWWSERVICE site."
echo "If you do not wish for this to occur, run the script with the --no-upload argument"
fi
echo ""
fi # NOUPLOAD
echo -n "Do you want to run this script? [y/n] : "
read -e CONFIRM
if [ "$CONFIRM" != "y" ]; then
echo ""
echo "Thank you for using the ALSA-Info Script"
exit 0;
fi
fi
fi # question
#Set the output file
TEMPDIR="/tmp/alsainfo/"
FILE="/tmp/alsa-info.txt"
if [ "$PROCEED" = "yes" ]; then
if [[ -z "$LSPCI" ]]
then
echo "This script requires lspci. Please install it, and re-run this script."
echo "Your ALSA information is located at $FINAL_URL"
echo "Please inform the person helping you."
echo ""
fi
fi
if [[ -n $DIALOG ]]
then
if [[ -n $NOUPLOAD ]]; then
if [[ -n $PBERROR ]]; then
dialog --backtitle "$BGTITLE" --title "Information collected" --msgbox "An error occured while contacting the $WWWSERVICE. Your information was NOT automatically uploaded.\n\nYour ALSA information can be seen by looking in $FILE" 10 100
else
dialog --backtitle "$BGTITLE" --title "Information collected" --msgbox "You requested that your information was NOT automatically uploaded to the $WWWSERVICE\n\nYour ALSA information can be seen by looking in $FILE" 10 100
fi
else
dialog --backtitle "$BGTITLE" --title "Information uploaded" --yesno "Would you like to see the uploaded information?" 5 100
echo "An error occured while contacting the $WWWSERVICE. Your information was NOT automatically uploaded."
echo ""
echo "Your ALSA information can be seen by looking in $FILE"
echo ""
else
echo "You requested that your information was NOT automatically uploaded to the $WWWSERVICE"
echo ""
echo "Your ALSA information can be seen by looking in $FILE"
echo ""
fi
fi
if [[ -z $NOUPLOAD ]]; then
echo "Your ALSA information is located at $FINAL_URL"
echo "Please inform the person helping you."
echo ""
fi
#We posted the file , so we dont need it anymore. delete it.
if [ -z $KEEP_FILES ]
then
rm $FILE
fi
#We couldnt find a suitable wget, so tell the user to upload manually.
else
if [[ -z $DIALOG ]]
then
if [[ -z $PASTEBIN ]]; then
echo ""
echo "Could not automatically upload output to http://www.alsa-project.org"
echo "Possible reasons are:"
echo " 1. Couldnt find 'wget' in your PATH"
echo " 2. Your version of wget is less than 1.8.2"
echo ""
echo "Please manually upload $FILE to http://www.alsa-project.org/cardinfo-db/ and submit your post."
echo ""
else
echo ""
echo "Could not automatically upload output to http://www.pastebin.ca"
echo "Possible reasons are:"
echo " 1. Couldnt find 'wget' in your PATH"
echo " 2. Your version of wget is less than 1.8.2"
echo ""
echo "Please manually upload $FILE to http://www.pastebin.ca/upload.php and submit your post."
echo ""
fi
fi
if [[ -n $DIALOG ]]
then
if [[ -z $PASTEBIN ]]; then
dialog --backtitle "$BGTITLE" --msgbox "Could not automatically upload output to http://www.alsa-project.org.\nPossible reasons are:\n\n 1. Couldn't find 'wget' in your PATH\n 2. Your version of wget is less than 1.8.2\n\nPlease manually upload $FILE to http://www.alsa-project,org/cardinfo-db/ and submit your post." 25 100
else
dialog --backtitle "$BGTITLE" --msgbox "Could not automatically upload output to http://www.pastebin.ca.\nPossible reasons are:\n\n 1. Couldn't find 'wget' in your PATH\n 2. Your version of wget is less than 1.8.2\n\nPlease manually upload $FILE to http://www.pastebin.ca/upload.php and submit your post." 25 100