"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "alsa-info/alsa-info.sh" between
alsa-utils-1.2.1.tar.bz2 and alsa-utils-1.2.2.tar.bz2

About: ALSA (Advanced Linux Sound Architecture) - Utilities.

alsa-info.sh  (alsa-utils-1.2.1.tar.bz2):alsa-info.sh  (alsa-utils-1.2.2.tar.bz2)
skipping to change at line 38 skipping to change at line 38
#Set the locale (this may or may not be a good idea.. let me know) #Set the locale (this may or may not be a good idea.. let me know)
export LC_ALL=C export LC_ALL=C
# Change the PATH variable, so we can run lspci (needed for some distros) # Change the PATH variable, so we can run lspci (needed for some distros)
PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin
BGTITLE="ALSA-Info v $SCRIPT_VERSION" BGTITLE="ALSA-Info v $SCRIPT_VERSION"
PASTEBINKEY="C9cRIO8m/9y8Cs0nVs0FraRx7U0pHsuc" PASTEBINKEY="C9cRIO8m/9y8Cs0nVs0FraRx7U0pHsuc"
WGET=$(which wget 2>/dev/null | sed 's|^[^/]*||' 2>/dev/null) WGET=$(which wget 2>/dev/null | sed 's|^[^/]*||' 2>/dev/null)
REQUIRES="mktemp grep pgrep whereis ping awk date uname cat dmesg amixer alsactl " REQUIRES="mktemp grep pgrep whereis awk date uname cat sort dmesg amixer alsactl "
# #
# Define some simple functions # Define some simple functions
# #
pbcheck() {
[[ $UPLOAD = "no" ]] && return
if [[ -z $PASTEBIN ]]; then
[[ $(ping -c1 www.alsa-project.org) ]] || KEEP_FILES="yes" UPLOAD
="no" PBERROR="yes"
else
[[ $(ping -c1 www.pastebin.ca) ]] || KEEP_FILES="yes" UPLOAD="no"
PBERROR="yes"
fi
}
update() { update() {
test -z "$WGET" -o ! -x "$WGET" && return test -z "$WGET" -o ! -x "$WGET" && return
SHFILE=$(mktemp -t alsa-info.XXXXXXXXXX) || exit 1 SHFILE=$(mktemp -t alsa-info.XXXXXXXXXX) || exit 1
wget -O $SHFILE "http://www.alsa-project.org/alsa-info.sh" >/dev/null 2>& 1 wget -O $SHFILE "http://www.alsa-project.org/alsa-info.sh" >/dev/null 2>& 1
REMOTE_VERSION=$(grep SCRIPT_VERSION $SHFILE | head -n1 | sed 's/.*=//') REMOTE_VERSION=$(grep SCRIPT_VERSION $SHFILE | head -n1 | sed 's/.*=//')
if [ -s "$SHFILE" -a "$REMOTE_VERSION" != "$SCRIPT_VERSION" ]; then if [ -s "$SHFILE" -a "$REMOTE_VERSION" != "$SCRIPT_VERSION" ]; then
if [[ -n $DIALOG ]] if [[ -n $DIALOG ]]
then then
OVERWRITE= OVERWRITE=
skipping to change at line 133 skipping to change at line 123
echo "APLAY" >> $FILE echo "APLAY" >> $FILE
echo "" >> $FILE echo "" >> $FILE
aplay -l >> $FILE 2>&1 aplay -l >> $FILE 2>&1
echo "" >> $FILE echo "" >> $FILE
echo "ARECORD" >> $FILE echo "ARECORD" >> $FILE
echo "" >> $FILE echo "" >> $FILE
arecord -l >> $FILE 2>&1 arecord -l >> $FILE 2>&1
echo "" >> $FILE echo "" >> $FILE
} }
withlsmod() { withmodules() {
echo "!!All Loaded Modules" >> $FILE echo "!!All Loaded Modules" >> $FILE
echo "!!------------------" >> $FILE echo "!!------------------" >> $FILE
echo "" >> $FILE echo "" >> $FILE
lsmod | awk '{print $1}' >> $FILE awk '{print $1}' < /proc/modules | sort >> $FILE
echo "" >> $FILE echo "" >> $FILE
echo "" >> $FILE echo "" >> $FILE
} }
withamixer() { withamixer() {
echo "!!Amixer output" >> $FILE echo "!!Amixer output" >> $FILE
echo "!!-------------" >> $FILE echo "!!-------------" >> $FILE
echo "" >> $FILE echo "" >> $FILE
for i in $(grep "]: " /proc/asound/cards | awk -F ' ' '{ print $1 }') ; d for f in /proc/asound/card*/id; do
o [ -f "$f" ] && read -r CARD_NAME < "$f" || continue
CARD_NAME=$(grep "^ *$i " $TEMPDIR/alsacards.tmp | awk '{ print $ echo "!!-------Mixer controls for card $CARD_NAME" >> $FILE
2 }')
echo "!!-------Mixer controls for card $i $CARD_NAME]" >> $FILE
echo "" >>$FILE echo "" >>$FILE
amixer -c$i info >> $FILE 2>&1 amixer -c "$CARD_NAME" info >> $FILE 2>&1
amixer -c$i >> $FILE 2>&1 amixer -c "$CARD_NAME" >> $FILE 2>&1
echo "" >> $FILE echo "" >> $FILE
done done
echo "" >> $FILE echo "" >> $FILE
} }
withalsactl() { withalsactl() {
echo "!!Alsactl output" >> $FILE echo "!!Alsactl output" >> $FILE
echo "!!--------------" >> $FILE echo "!!--------------" >> $FILE
echo "" >> $FILE echo "" >> $FILE
alsactl -f $TEMPDIR/alsactl.tmp store alsactl -f $TEMPDIR/alsactl.tmp store
skipping to change at line 256 skipping to change at line 246
echo "" >> $FILE echo "" >> $FILE
echo "" >> $FILE echo "" >> $FILE
} }
withall() { withall() {
withdevices withdevices
withconfigs withconfigs
withaplay withaplay
withamixer withamixer
withalsactl withalsactl
withlsmod withmodules
withsysfs withsysfs
withdmesg withdmesg
WITHALL="no" WITHALL="no"
} }
get_alsa_library_version() { get_alsa_library_version() {
ALSA_LIB_VERSION=$(grep VERSION_STR /usr/include/alsa/version.h 2>/dev/nu ll | awk '{ print $3 }' | sed 's/"//g') ALSA_LIB_VERSION=$(grep VERSION_STR /usr/include/alsa/version.h 2>/dev/nu ll | awk '{ print $3 }' | sed 's/"//g')
if [ -z "$ALSA_LIB_VERSION" ]; then if [ -z "$ALSA_LIB_VERSION" ]; then
if [ -f /etc/lsb-release ]; then if [ -f /etc/lsb-release ]; then
skipping to change at line 351 skipping to change at line 341
PASTEBIN="yes" PASTEBIN="yes"
WWWSERVICE="pastebin" WWWSERVICE="pastebin"
;; ;;
--no-dialog) --no-dialog)
DIALOG="" DIALOG=""
REPEAT="" REPEAT=""
shift shift
;; ;;
--stdout) --stdout)
DIALOG="" DIALOG=""
UPLOAD="no"
WELCOME="no" WELCOME="no"
TOSTDOUT="yes"
;; ;;
esac esac
done done
#Script header output. #Script header output.
if [ "$WELCOME" = "yes" ]; then if [ "$WELCOME" = "yes" ]; then
greeting_message="\ greeting_message="\
This script visits the following commands/files to collect diagnostic This script visits the following commands/files to collect diagnostic
information about your ALSA installation and sound related hardware. information about your ALSA installation and sound related hardware.
dmesg dmesg
lspci lspci
lsmod
aplay aplay
amixer amixer
alsactl alsactl
/proc/asound/ /proc/asound/
/sys/class/sound/ /sys/class/sound/
~/.asoundrc (etc.) ~/.asoundrc (etc.)
See '$0 --help' for command line options. See '$0 --help' for command line options.
" "
if [ -n "$DIALOG" ]; then if [ -n "$DIALOG" ]; then
skipping to change at line 456 skipping to change at line 443
ACPI_STATUS=$(cat $f 2>/dev/null); ACPI_STATUS=$(cat $f 2>/dev/null);
if [[ "$ACPI_STATUS" -ne 0 ]]; then if [[ "$ACPI_STATUS" -ne 0 ]]; then
echo $f $'\t' $ACPI_STATUS >>$TEMPDIR/acpidevicestatus.tmp; echo $f $'\t' $ACPI_STATUS >>$TEMPDIR/acpidevicestatus.tmp;
fi fi
done done
fi fi
cat /proc/asound/modules 2>/dev/null | awk '{ print $2 }' > $TEMPDIR/alsamodules .tmp cat /proc/asound/modules 2>/dev/null | awk '{ print $2 }' > $TEMPDIR/alsamodules .tmp
cat /proc/asound/cards > $TEMPDIR/alsacards.tmp cat /proc/asound/cards > $TEMPDIR/alsacards.tmp
if [[ ! -z "$LSPCI" ]]; then if [[ ! -z "$LSPCI" ]]; then
lspci | grep -i "multi\|audio">$TEMPDIR/lspci.tmp for class in 0401 0402 0403; do
lspci -vvnn -d "::$class" | sed -n '/^[^\t]/,+1p'
done > $TEMPDIR/lspci.tmp
fi fi
#Check for HDA-Intel cards codec#* #Check for HDA-Intel cards codec#*
cat /proc/asound/card*/codec\#* > $TEMPDIR/alsa-hda-intel.tmp 2> /dev/null cat /proc/asound/card*/codec\#* > $TEMPDIR/alsa-hda-intel.tmp 2> /dev/null
#Check for AC97 cards codec #Check for AC97 cards codec
cat /proc/asound/card*/codec97\#0/ac97\#0-0 > $TEMPDIR/alsa-ac97.tmp 2> /dev/nul l cat /proc/asound/card*/codec97\#0/ac97\#0-0 > $TEMPDIR/alsa-ac97.tmp 2> /dev/nul l
cat /proc/asound/card*/codec97\#0/ac97\#0-0+regs > $TEMPDIR/alsa-ac97-regs.tmp 2 > /dev/null cat /proc/asound/card*/codec97\#0/ac97\#0-0+regs > $TEMPDIR/alsa-ac97-regs.tmp 2 > /dev/null
#Check for USB mixer setup #Check for USB mixer setup
skipping to change at line 586 skipping to change at line 575
echo "" >> $FILE echo "" >> $FILE
echo "" >> $FILE echo "" >> $FILE
if [[ ! -z "$LSPCI" ]]; then if [[ ! -z "$LSPCI" ]]; then
echo "!!PCI Soundcards installed in the system" >> $FILE echo "!!PCI Soundcards installed in the system" >> $FILE
echo "!!--------------------------------------" >> $FILE echo "!!--------------------------------------" >> $FILE
echo "" >> $FILE echo "" >> $FILE
cat $TEMPDIR/lspci.tmp >> $FILE cat $TEMPDIR/lspci.tmp >> $FILE
echo "" >> $FILE echo "" >> $FILE
echo "" >> $FILE echo "" >> $FILE
echo "!!Advanced information - PCI Vendor/Device/Subsystem ID's" >> $FILE
echo "!!-------------------------------------------------------" >> $FILE
echo "" >> $FILE
lspci -vvn |grep -A1 040[1-3] >> $FILE
echo "" >> $FILE
echo "" >> $FILE
fi fi
if [ "$SNDOPTIONS" ] if [ "$SNDOPTIONS" ]
then then
echo "!!Modprobe options (Sound related)" >> $FILE echo "!!Modprobe options (Sound related)" >> $FILE
echo "!!--------------------------------" >> $FILE echo "!!--------------------------------" >> $FILE
echo "" >> $FILE echo "" >> $FILE
modprobe -c|sed -n 's/^options \(snd[-_][^ ]*\)/\1:/p' >> $FILE modprobe -c|sed -n 's/^options \(snd[-_][^ ]*\)/\1:/p' >> $FILE
echo "" >> $FILE echo "" >> $FILE
echo "" >> $FILE echo "" >> $FILE
skipping to change at line 658 skipping to change at line 641
echo "" >> $FILE echo "" >> $FILE
cat $TEMPDIR/alsa-usbmixer.tmp >> $FILE cat $TEMPDIR/alsa-usbmixer.tmp >> $FILE
echo "--endcollapse--" >> $FILE echo "--endcollapse--" >> $FILE
echo "" >> $FILE echo "" >> $FILE
echo "" >> $FILE echo "" >> $FILE
fi fi
#If no command line options are specified, then run as though --with-all was spe cified #If no command line options are specified, then run as though --with-all was spe cified
if [ -z "$1" ]; then if [ -z "$1" ]; then
update update
pbcheck
fi fi
fi # proceed fi # proceed
#loop through command line arguments, until none are left. #loop through command line arguments, until none are left.
if [ -n "$1" ]; then if [ -n "$1" ]; then
until [ -z "$1" ] until [ -z "$1" ]
do do
case "$1" in case "$1" in
--pastebin) --pastebin)
update update
pbcheck
;; ;;
--update) --update)
update update
exit exit
;; ;;
--upload) --upload)
UPLOAD="yes" UPLOAD="yes"
;; ;;
--no-upload) --no-upload)
UPLOAD="no" UPLOAD="no"
skipping to change at line 716 skipping to change at line 697
;; ;;
--with-devices) --with-devices)
withdevices withdevices
WITHALL="no" WITHALL="no"
;; ;;
--with-dmesg) --with-dmesg)
withdmesg withdmesg
WITHALL="no" WITHALL="no"
;; ;;
--with-configs) --with-configs)
withconfigs
WITHALL="no" WITHALL="no"
if [[ -e $HOME/.asoundrc ]] || [[ -e /etc/asound.conf ]]
then
echo "!!ALSA configuration files" >> $FILE
echo "!!------------------------" >> $FILE
echo "" >> $FILE
#Check for ~/.asoundrc
if [[ -e $HOME/.asoundrc ]]
then
echo "!!User specific config file ($HOME/
.asoundrc)" >> $FILE
echo "" >> $FILE
cat $HOME/.asoundrc >> $FILE
echo "" >> $FILE
echo "" >> $FILE
fi
#Check for /etc/asound.conf
if [[ -e /etc/asound.conf ]]
then
echo "!!System wide config file (/etc/aso
und.conf)" >> $FILE
echo "" >> $FILE
cat /etc/asound.conf >> $FILE
echo "" >> $FILE
echo "" >> $FILE
fi
fi
;; ;;
--stdout) --stdout)
UPLOAD="no" UPLOAD="no"
if [ -z "$WITHALL" ]; then if [ -z "$WITHALL" ]; then
withall withall
fi fi
cat $FILE cat $FILE
rm $FILE rm $FILE
exit
;; ;;
--about) --about)
echo "Written/Tested by the following users of #alsa on i rc.freenode.net:" echo "Written/Tested by the following users of #alsa on i rc.freenode.net:"
echo "" echo ""
echo " wishie - Script author and developer / Testing" echo " wishie - Script author and developer / Testing"
echo " crimsun - Various script ideas / Testing" echo " crimsun - Various script ideas / Testing"
echo " gnubien - Various script ideas / Testing" echo " gnubien - Various script ideas / Testing"
echo " GrueMaster - HDA Intel specific items / Testing" echo " GrueMaster - HDA Intel specific items / Testing"
echo " olegfink - Script update function" echo " olegfink - Script update function"
echo " TheMuso - display to stdout functionality" echo " TheMuso - display to stdout functionality"
skipping to change at line 801 skipping to change at line 758
fi fi
if [ "$PROCEED" = "no" ]; then if [ "$PROCEED" = "no" ]; then
exit 1 exit 1
fi fi
if [ -z "$WITHALL" ]; then if [ -z "$WITHALL" ]; then
withall withall
fi fi
# Check if wget is installed, and supports --post-file.
if ! wget --help 2>/dev/null | grep -q post-file; then
# We couldn't find a suitable wget. If --upload was passed, tell the user
to upload manually.
if [ "$UPLOAD" != "yes" ]; then
:
elif [ -n "$DIALOG" ]; then
if [ -z "$PASTEBIN" ]; then
dialog --backtitle "$BGTITLE" --msgbox "Could not automat
ically 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 tha
n 1.8.2\n\nPlease manually upload $NFILE to http://www.alsa-project.org/cardinfo
-db/ and submit your post." 25 100
else
dialog --backtitle "$BGTITLE" --msgbox "Could not automat
ically 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 $NFILE to http://www.pastebin.ca/upload.php and sub
mit your post." 25 100
fi
else
if [ -z "$PASTEBIN" ]; then
echo ""
echo "Could not automatically upload output to http://www
.alsa-project.org"
echo "Possible reasons are:"
echo " 1. Couldn't find 'wget' in your PATH"
echo " 2. Your version of wget is less than 1.8.2"
echo ""
echo "Please manually upload $NFILE to http://www.alsa-pr
oject.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. Couldn't find 'wget' in your PATH"
echo " 2. Your version of wget is less than 1.8.2"
echo ""
echo "Please manually upload $NFILE to http://www.pastebi
n.ca/upload.php and submit your post."
echo ""
fi
fi
UPLOAD="no"
fi
if [ "$UPLOAD" = "ask" ]; then if [ "$UPLOAD" = "ask" ]; then
if [ -n "$DIALOG" ]; then if [ -n "$DIALOG" ]; then
dialog --backtitle "$BGTITLE" --title "Information collected" --y es-label " UPLOAD / SHARE " --no-label " SAVE LOCALLY " --defaultno --yesno "\n\ nAutomatically upload ALSA information to $WWWSERVICE?" 10 80 dialog --backtitle "$BGTITLE" --title "Information collected" --y es-label " UPLOAD / SHARE " --no-label " SAVE LOCALLY " --defaultno --yesno "\n\ nAutomatically upload ALSA information to $WWWSERVICE?" 10 80
DIALOG_EXIT_CODE=$? DIALOG_EXIT_CODE=$?
if [ $DIALOG_EXIT_CODE != 0 ]; then if [ $DIALOG_EXIT_CODE != 0 ]; then
UPLOAD="no" UPLOAD="no"
else else
UPLOAD="yes" UPLOAD="yes"
fi fi
else else
skipping to change at line 824 skipping to change at line 816
UPLOAD="no" UPLOAD="no"
else else
UPLOAD="yes" UPLOAD="yes"
fi fi
fi fi
fi fi
if [ "$UPLOAD" = "no" ]; then if [ "$UPLOAD" = "no" ]; then
if [ -z "$TOSTDOUT" ]; then mv -f $FILE $NFILE || exit 1
mv -f $FILE $NFILE || exit 1 KEEP_OUTPUT="yes"
KEEP_OUTPUT="yes"
fi
if [[ -n $DIALOG ]] if [[ -n $DIALOG ]]
then then
if [[ -n $PBERROR ]]; then dialog --backtitle "$BGTITLE" --title "Information collected" --m
dialog --backtitle "$BGTITLE" --title "Information collec sgbox "\n\nYour ALSA information is in $NFILE" 10 60
ted" --msgbox "An error occurred while contacting the $WWWSERVICE.\n Your inform
ation was NOT automatically uploaded.\n\nYour ALSA information is in $NFILE" 10
100
else
dialog --backtitle "$BGTITLE" --title "Information collec
ted" --msgbox "\n\nYour ALSA information is in $NFILE" 10 60
fi
else else
echo echo ""
echo "Your ALSA information is in $NFILE"
if [[ -n $PBERROR ]]; then echo ""
echo "An error occurred while contacting the $WWWSERVICE.
"
echo "Your information was NOT automatically uploaded."
echo ""
echo "Your ALSA information is in $NFILE"
echo ""
else
if [ -z "$TOSTDOUT" ]; then
echo ""
echo "Your ALSA information is in $NFILE"
echo ""
fi
fi
fi fi
exit exit
fi # UPLOAD fi # UPLOAD
# Test that wget is installed, and supports --post-file. Upload $FILE if it does
, and prompt user to upload file if it does not.
if [[ -n "${WGET}" ]] && [[ -x "${WGET}" ]] && [[ $(wget --help | grep post-file
) ]]
then
if [[ -n $DIALOG ]] if [[ -n $DIALOG ]]
then then
dialog --backtitle "$BGTITLE" --infobox "Uploading information to $WWWSER
VICE ..." 6 70
else
echo -n "Uploading information to $WWWSERVICE ..."
fi
if [[ -z $PASTEBIN ]]; then if [[ -z $PASTEBIN ]]; then
wget -O - --tries=5 --timeout=60 --post-file=$FILE "http://www.alsa-proje wget -O - --tries=5 --timeout=60 --post-file=$FILE "http://www.alsa-proje
ct.org/cardinfo-db/" &>$TEMPDIR/wget.tmp || echo "Upload failed; exit" ct.org/cardinfo-db/" &>$TEMPDIR/wget.tmp
{ for i in 10 20 30 40 50 60 70 80 90; do
echo $i
sleep 0.2
done
echo; } |dialog --backtitle "$BGTITLE" --guage "Uploading information to
www.alsa-project.org ..." 6 70 0
else else
wget -O - --tries=5 --timeout=60 --post-file=$FILE "http://pastebin.ca/qu wget -O - --tries=5 --timeout=60 --post-file=$FILE "http://pastebin.ca/qu
iet-paste.php?api=$PASTEBINKEY&encrypt=t&encryptpw=blahblah" &>$TEMPDIR/wget.tmp iet-paste.php?api=$PASTEBINKEY&encrypt=t&encryptpw=blahblah" &>$TEMPDIR/wget.tmp
|| echo "Upload failed; exit"
{ for i in 10 20 30 40 50 60 70 80 90; do
echo $i
sleep 0.2
done
echo; } |dialog --backtitle "$BGTITLE" --guage "Uploading information to
www.pastebin.ca ..." 6 70 0
fi fi
if [ $? -ne 0 ]; then
mv -f $FILE $NFILE || exit 1
KEEP_OUTPUT="yes"
if [ -n "$DIALOG" ]; then
dialog --backtitle "$BGTITLE" --title "Information not uploaded"
--msgbox "An error occurred while contacting $WWWSERVICE.\n Your information was
NOT automatically uploaded.\n\nYour ALSA information is in $NFILE" 10 100
else
echo ""
echo "An error occurred while contacting $WWWSERVICE."
echo "Your information was NOT automatically uploaded."
echo ""
echo "Your ALSA information is in $NFILE"
echo ""
fi
exit
fi
if [ -n "$DIALOG" ]; then
dialog --backtitle "$BGTITLE" --title "Information uploaded" --yesno "Would you like to see the uploaded information?" 5 100 dialog --backtitle "$BGTITLE" --title "Information uploaded" --yesno "Would you like to see the uploaded information?" 5 100
DIALOG_EXIT_CODE=$? DIALOG_EXIT_CODE=$?
if [ $DIALOG_EXIT_CODE = 0 ]; then if [ $DIALOG_EXIT_CODE = 0 ]; then
grep -v "alsa-info.txt" $FILE > $TEMPDIR/uploaded.txt grep -v "alsa-info.txt" $FILE > $TEMPDIR/uploaded.txt
dialog --backtitle "$BGTITLE" --textbox $TEMPDIR/uploaded.txt 0 0 dialog --backtitle "$BGTITLE" --textbox $TEMPDIR/uploaded.txt 0 0
fi fi
clear clear
# no dialog # no dialog
else else
if [[ -z $PASTEBIN ]]; then echo -e " Done!"
echo -n "Uploading information to www.alsa-project.org ... "
wget -O - --tries=5 --timeout=60 --post-file=$FILE http://www.alsa-projec
t.org/cardinfo-db/ &>$TEMPDIR/wget.tmp &
else
echo -n "Uploading information to www.pastebin.ca ... "
wget -O - --tries=5 --timeout=60 --post-file=$FILE http://pastebin.ca/qui
et-paste.php?api=$PASTEBINKEY &>$TEMPDIR/wget.tmp &
fi
#Progess spinner for wget transfer.
i=1
sp="/-\|"
echo -n ' '
while pgrep wget &>/dev/null
do
echo -en "\b${sp:i++%${#sp}:1}"
done
echo -e "\b Done!"
echo "" echo ""
fi # dialog fi # dialog
# See if tput is available, and use it if it is. if [ -z "$PASTEBIN" ]; then
if [ -n "$TPUT" ]; then FINAL_URL=$(grep "SUCCESS:" $TEMPDIR/wget.tmp | cut -d ' ' -f 2)
if [[ -z $PASTEBIN ]]; then
FINAL_URL=$(tput setaf 1; grep "SUCCESS:" $TEMPDIR/wget.tmp | cut
-d ' ' -f 2 ; tput sgr0)
else
FINAL_URL=$(tput setaf 1; grep "SUCCESS:" $TEMPDIR/wget.tmp | sed
-n 's/.*\:\([0-9]\+\).*/http:\/\/pastebin.ca\/\1/p'; tput sgr0)
fi
else else
if [[ -z $PASTEBIN ]]; then FINAL_URL=$(grep "SUCCESS:" $TEMPDIR/wget.tmp | sed -n 's/.*\:\([0-9]\+\)
FINAL_URL=$(grep "SUCCESS:" $TEMPDIR/wget.tmp | cut -d ' ' -f 2) .*/http:\/\/pastebin.ca\/\1/p')
else fi
FINAL_URL=$(grep "SUCCESS:" $TEMPDIR/wget.tmp | sed -n 's/.*\:\([
0-9]\+\).*/http:\/\/pastebin.ca\/\1/p') # See if tput is available, and use it if it is.
fi if [ -x "$TPUT" ]; then
FINAL_URL=$(tput setaf 1; printf '%s' "$FINAL_URL"; tput sgr0)
fi fi
# Output the URL of the uploaded file. # Output the URL of the uploaded file.
echo "Your ALSA information is located at $FINAL_URL" echo "Your ALSA information is located at $FINAL_URL"
echo "Please inform the person helping you." echo "Please inform the person helping you."
echo "" echo ""
# We couldnt find a suitable wget, so tell the user to upload manually.
else
mv -f $FILE $NFILE || exit 1
KEEP_OUTPUT="yes"
if [[ -z $DIALOG ]]
then
if [[ -z $PASTEBIN ]]; then
echo ""
echo "Could not automatically upload output to http://www.alsa-pr
oject.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 $NFILE to http://www.alsa-project.or
g/cardinfo-db/ and submit your post."
echo ""
else
echo ""
echo "Could not automatically upload output to http://www.pastebi
n.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 $NFILE to http://www.pastebin.ca/upl
oad.php and submit your post."
echo ""
fi
else
if [[ -z $PASTEBIN ]]; then
dialog --backtitle "$BGTITLE" --msgbox "Could not automat
ically 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 tha
n 1.8.2\n\nPlease manually upload $NFILE to http://www.alsa-project,org/cardinfo
-db/ and submit your post." 25 100
else
dialog --backtitle "$BGTITLE" --msgbox "Could not automat
ically 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 $NFILE to http://www.pastebin.ca/upload.php and sub
mit your post." 25 100
fi
fi
fi
 End of changes. 30 change blocks. 
150 lines changed or deleted 110 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)