efe9b52
#!/bin/bash
efe9b52
Jaroslav Kysela 71ac133
SCRIPT_VERSION=0.4.60
a657df4
CHANGELOG="http://www.alsa-project.org/alsa-info.sh.changelog"
efe9b52
efe9b52
#################################################################################
efe9b52
#Copyright (C) 2007 Free Software Foundation.
efe9b52
efe9b52
#This program is free software; you can redistribute it and/or modify
efe9b52
#it under the terms of the GNU General Public License as published by
efe9b52
#the Free Software Foundation; either version 2 of the License, or
efe9b52
#(at your option) any later version.
efe9b52
efe9b52
#This program is distributed in the hope that it will be useful,
efe9b52
#but WITHOUT ANY WARRANTY; without even the implied warranty of
efe9b52
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
efe9b52
#GNU General Public License for more details.
efe9b52
efe9b52
#You should have received a copy of the GNU General Public License
efe9b52
#along with this program; if not, write to the Free Software
efe9b52
#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
efe9b52
efe9b52
##################################################################################
efe9b52
efe9b52
#The script was written for 2 main reasons:
efe9b52
# 1. Remove the need for the devs/helpers to ask several questions before we can easily help the user.
efe9b52
# 2. Allow newer/inexperienced ALSA users to give us all the info we need to help them.
efe9b52
2a14aae
#Set the locale (this may or may not be a good idea.. let me know)
2a14aae
export LC_ALL=C
2a14aae
efe9b52
#Change the PATH variable, so we can run lspci (needed for some distros)
efe9b52
PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin
efe9b52
BGTITLE="ALSA-Info v $SCRIPT_VERSION"
efe9b52
PASTEBINKEY="C9cRIO8m/9y8Cs0nVs0FraRx7U0pHsuc"
efe9b52
#Define some simple functions
efe9b52
a657df4
pbcheck(){
46b1063
	[[ $UPLOAD = "no" ]] && return
46b1063
1e0bef8
	if [[ -z $PASTEBIN ]]; then
46b1063
		[[ $(ping -c1 www.alsa-project.org) ]] || KEEP_FILES="yes" UPLOAD="no" PBERROR="yes"
1e0bef8
	else
46b1063
		[[ $(ping -c1 www.pastebin.ca) ]] || KEEP_FILES="yes" UPLOAD="no" PBERROR="yes"
1e0bef8
	fi
a657df4
}
a657df4
efe9b52
update() {
46b1063
	SHFILE=`mktemp -t alsa-info.XXXXXXXXXX` || exit 1
2a14aae
	wget -O $SHFILE "http://www.alsa-project.org/alsa-info.sh" >/dev/null 2>&1
2a14aae
	REMOTE_VERSION=`grep SCRIPT_VERSION $SHFILE |head -n1 |sed 's/.*=//'`
efe9b52
	if [ "$REMOTE_VERSION" != "$SCRIPT_VERSION" ]; then
efe9b52
		if [[ -n $DIALOG ]]
efe9b52
		then
2a14aae
			OVERWRITE=
6817025
			if [ -w $0 ]; then
2a14aae
				dialog --yesno "Newer version of ALSA-Info has been found\n\nDo you wish to install it?\nNOTICE: The original file $0 will be overwritten!" 0 0
2a14aae
				DIALOG_EXIT_CODE=$?
2a14aae
				if [[ $DIALOG_EXIT_CODE = 0 ]]; then
2a14aae
				  OVERWRITE=yes
2a14aae
				fi
2a14aae
			fi
2a14aae
			if [ -z "$OVERWRITE" ]; then
6817025
				dialog --yesno "Newer version of ALSA-Info has been found\n\nDo you wish to download it?" 0 0
2a14aae
				DIALOG_EXIT_CODE=$?
6817025
			fi
efe9b52
			if [[ $DIALOG_EXIT_CODE = 0 ]]
efe9b52
			then
6817025
				echo "Newer version detected: $REMOTE_VERSION"
efe9b52
				echo "To view the ChangeLog, please visit $CHANGELOG"
2a14aae
				if [ "$OVERWRITE" = "yes" ]; then
2a14aae
					cp $SHFILE $0
6817025
					echo "ALSA-Info script has been updated to v $REMOTE_VERSION"
6817025
					echo "Please re-run the script"
2a14aae
					rm $SHFILE 2>/dev/null
6817025
				else
46b1063
					echo "ALSA-Info script has been downloaded as $SHFILE."
6817025
					echo "Please re-run the script from new location."
6817025
				fi
efe9b52
				exit
6817025
			else
2a14aae
				rm $SHFILE 2>/dev/null
efe9b52
			fi
efe9b52
		else
efe9b52
			echo "Newer version detected: $REMOTE_VERSION"
efe9b52
			echo "To view the ChangeLog, please visit $CHANGELOG"
6817025
			if [ -w $0 ]; then
2a14aae
				echo "The original file $0 will be overwritten!"
2a14aae
				echo -n "If you do not like to proceed, press Ctrl-C now.." ; read inp
2a14aae
				cp $SHFILE $0
6817025
				echo "ALSA-Info script has been updated. Please re-run it."
2a14aae
				rm $SHFILE 2>/dev/null
6817025
			else
46b1063
				echo "ALSA-Info script has been downloaded $SHFILE."
6817025
				echo "Please, re-run it from new location."
6817025
			fi
efe9b52
			exit
efe9b52
		fi
6817025
	else
2a14aae
		rm $SHFILE 2>/dev/null
efe9b52
	fi
efe9b52
}
efe9b52
efe9b52
cleanup() {
bbe9f6c
	if [ -n "$TEMPDIR" -a "$KEEP_FILES" != "yes" ]; then
46b1063
		rm -rf "$TEMPDIR" 2>/dev/null
bbe9f6c
	fi
46b1063
	test -n "$KEEP_OUTPUT" || rm -f "$NFILE"
efe9b52
}
efe9b52
efe9b52
efe9b52
withaplay() {
efe9b52
        echo "!!Aplay/Arecord output" >> $FILE
efe9b52
        echo "!!------------" >> $FILE
efe9b52
        echo "" >> $FILE
efe9b52
       	echo "APLAY" >> $FILE
efe9b52
	echo "" >> $FILE 
a657df4
	aplay -l >> $FILE 2>&1
efe9b52
        echo "" >> $FILE
efe9b52
       	echo "ARECORD" >> $FILE
efe9b52
	echo "" >> $FILE
a657df4
	arecord -l >> $FILE 2>&1
efe9b52
	echo "" >> $FILE
efe9b52
}
efe9b52
efe9b52
withlsmod() {
efe9b52
	echo "!!All Loaded Modules" >> $FILE
efe9b52
	echo "!!------------------" >> $FILE
efe9b52
	echo "" >> $FILE
efe9b52
	lsmod |awk {'print $1'} >> $FILE
efe9b52
	echo "" >> $FILE
efe9b52
	echo "" >> $FILE
efe9b52
}
efe9b52
efe9b52
withamixer() {
efe9b52
        echo "!!Amixer output" >> $FILE
efe9b52
        echo "!!-------------" >> $FILE
efe9b52
        echo "" >> $FILE
efe9b52
	for i in `grep "]: " /proc/asound/cards | awk -F ' ' '{ print $1} '` ; do
2a14aae
	CARD_NAME=`grep "^ *$i " $TEMPDIR/alsacards.tmp|awk {'print $2'}`
efe9b52
	echo "!!-------Mixer controls for card $i $CARD_NAME]" >> $FILE
efe9b52
	echo "" >>$FILE
1e0bef8
	amixer -c$i info>> $FILE 2>&1
a657df4
	amixer -c$i>> $FILE 2>&1
efe9b52
        echo "" >> $FILE
efe9b52
	done
efe9b52
	echo "" >> $FILE
efe9b52
}
efe9b52
efe9b52
withalsactl() {
efe9b52
	echo "!!Alsactl output" >> $FILE
efe9b52
        echo "!!-------------" >> $FILE
efe9b52
        echo "" >> $FILE
efe9b52
        exe=""
efe9b52
        if [ -x /usr/sbin/alsactl ]; then
efe9b52
        	exe="/usr/sbin/alsactl"
efe9b52
        fi
efe9b52
        if [ -x /usr/local/sbin/alsactl ]; then
efe9b52
        	exe="/usr/local/sbin/alsactl"
efe9b52
        fi
efe9b52
        if [ -z "$exe" ]; then
efe9b52
        	exe=`whereis alsactl | cut -d ' ' -f 2`
efe9b52
        fi
2a14aae
	$exe -f $TEMPDIR/alsactl.tmp store
efe9b52
	echo "--startcollapse--" >> $FILE
2a14aae
	cat $TEMPDIR/alsactl.tmp >> $FILE
efe9b52
	echo "--endcollapse--" >> $FILE
efe9b52
	echo "" >> $FILE
efe9b52
	echo "" >> $FILE
efe9b52
}
efe9b52
efe9b52
withdevices() {
efe9b52
        echo "!!ALSA Device nodes" >> $FILE
efe9b52
        echo "!!-----------------" >> $FILE
efe9b52
        echo "" >> $FILE
efe9b52
        ls -la /dev/snd/* >> $FILE
efe9b52
        echo "" >> $FILE
efe9b52
        echo "" >> $FILE
efe9b52
}
efe9b52
efe9b52
withconfigs() {
efe9b52
if [[ -e $HOME/.asoundrc ]] || [[ -e /etc/asound.conf ]] || [[ -e $HOME/.asoundrc.asoundconf ]]
efe9b52
then
efe9b52
        echo "!!ALSA configuration files" >> $FILE
efe9b52
        echo "!!------------------------" >> $FILE
efe9b52
        echo "" >> $FILE
efe9b52
efe9b52
        #Check for ~/.asoundrc
efe9b52
        if [[ -e $HOME/.asoundrc ]]
efe9b52
        then
efe9b52
                echo "!!User specific config file (~/.asoundrc)" >> $FILE
efe9b52
                echo "" >> $FILE
efe9b52
                cat $HOME/.asoundrc >> $FILE
efe9b52
                echo "" >> $FILE
efe9b52
                echo "" >> $FILE
efe9b52
        fi
efe9b52
	#Check for .asoundrc.asoundconf (seems to be Ubuntu specific)
efe9b52
	if [[ -e $HOME/.asoundrc.asoundconf ]]
efe9b52
	then
efe9b52
		echo "!!asoundconf-generated config file" >> $FILE
efe9b52
		echo "" >> $FILE
efe9b52
		cat $HOME/.asoundrc.asoundconf >> $FILE
efe9b52
		echo "" >> $FILE
efe9b52
		echo "" >> $FILE
efe9b52
	fi
efe9b52
        #Check for /etc/asound.conf
efe9b52
        if [[ -e /etc/asound.conf ]]
efe9b52
        then
efe9b52
                echo "!!System wide config file (/etc/asound.conf)" >> $FILE
efe9b52
                echo "" >> $FILE
efe9b52
                cat /etc/asound.conf >> $FILE
efe9b52
                echo "" >> $FILE
efe9b52
                echo "" >> $FILE
efe9b52
        fi
efe9b52
fi
efe9b52
}
efe9b52
bbe9f6c
withsysfs() {
bbe9f6c
    local i f
bbe9f6c
    local printed=""
bbe9f6c
    for i in /sys/class/sound/*; do
bbe9f6c
	case "$i" in
bbe9f6c
	    */hwC?D?)
bbe9f6c
		if [ -f $i/init_pin_configs ]; then
bbe9f6c
		    if [ -z "$printed" ]; then
bbe9f6c
			echo "!!Sysfs Files" >> $FILE
bbe9f6c
			echo "!!-----------" >> $FILE
bbe9f6c
			echo "" >> $FILE
bbe9f6c
		    fi
bbe9f6c
		    for f in init_pin_configs driver_pin_configs user_pin_configs init_verbs; do
bbe9f6c
			echo "$i/$f:" >> $FILE
bbe9f6c
			cat $i/$f >> $FILE
bbe9f6c
			echo >> $FILE
bbe9f6c
		    done
bbe9f6c
		    printed=yes
bbe9f6c
		fi
bbe9f6c
		;;
bbe9f6c
	    esac
bbe9f6c
    done
bbe9f6c
    if [ -n "$printed" ]; then
bbe9f6c
	echo "" >> $FILE
bbe9f6c
    fi
bbe9f6c
}
bbe9f6c
46b1063
withdmesg() {
46b1063
	echo "!!ALSA/HDA dmesg" >> $FILE
46b1063
	echo "!!------------------" >> $FILE
46b1063
	echo "" >> $FILE
46b1063
	dmesg | grep -C1 -E 'ALSA|HDA|HDMI|sound|hda.codec|hda.intel' >> $FILE
46b1063
	echo "" >> $FILE
46b1063
	echo "" >> $FILE
46b1063
}
46b1063
46b1063
withall() {
46b1063
	withdevices
46b1063
	withconfigs
46b1063
	withaplay
46b1063
	withamixer
46b1063
	withalsactl
46b1063
	withlsmod
46b1063
	withsysfs
46b1063
	withdmesg
46b1063
}
46b1063
bbe9f6c
get_alsa_library_version() {
bbe9f6c
	ALSA_LIB_VERSION=`grep VERSION_STR /usr/include/alsa/version.h 2>/dev/null|awk {'print $3'}|sed 's/"//g'`
bbe9f6c
bbe9f6c
	if [ -z "$ALSA_LIB_VERSION" ]; then
bbe9f6c
		if [ -f /etc/lsb-release ]; then
bbe9f6c
			. /etc/lsb-release
bbe9f6c
			case "$DISTRIB_ID" in
bbe9f6c
				Ubuntu)
bbe9f6c
					if which dpkg > /dev/null ; then
bbe9f6c
						ALSA_LIB_VERSION=`dpkg -l libasound2 | tail -1 | awk '{print $3}' | cut -f 1 -d -`
bbe9f6c
					fi
bbe9f6c
bbe9f6c
					if [ "$ALSA_LIB_VERSION" = "<none>" ]; then
bbe9f6c
						ALSA_LIB_VERSION=""
bbe9f6c
					fi
bbe9f6c
					return
bbe9f6c
					;;
bbe9f6c
				*)
bbe9f6c
					return
bbe9f6c
					;;
bbe9f6c
			esac
bbe9f6c
		elif [ -f /etc/debian_version ]; then
bbe9f6c
			if which dpkg > /dev/null ; then
bbe9f6c
				ALSA_LIB_VERSION=`dpkg -l libasound2 | tail -1 | awk '{print $3}' | cut -f 1 -d -`
bbe9f6c
			fi
bbe9f6c
bbe9f6c
			if [ "$ALSA_LIB_VERSION" = "<none>" ]; then
bbe9f6c
				ALSA_LIB_VERSION=""
bbe9f6c
			fi
bbe9f6c
			return
bbe9f6c
		fi
bbe9f6c
	fi
bbe9f6c
}
bbe9f6c
efe9b52
efe9b52
#Run checks to make sure the programs we need are installed.
efe9b52
LSPCI=$(which lspci 2>/dev/null| sed 's|^[^/]*||' 2>/dev/null);
efe9b52
TPUT=$(which tput 2>/dev/null| sed 's|^[^/]*||' 2>/dev/null);
efe9b52
DIALOG=$(which dialog 2>/dev/null | sed 's|^[^/]*||' 2>/dev/null);
efe9b52
efe9b52
#Check to see if sysfs is enabled in the kernel. We'll need this later on
efe9b52
SYSFS=$(mount |grep sysfs|awk {'print $3'});
efe9b52
efe9b52
#Check modprobe config files for sound related options
efe9b52
SNDOPTIONS=$(modprobe -c|sed -n 's/^options \(snd[-_][^ ]*\)/\1:/p')
efe9b52
46b1063
KEEP_OUTPUT=
46b1063
NFILE=""
46b1063
1e0bef8
PASTEBIN=""
1e0bef8
WWWSERVICE="www.alsa-project.org"
46b1063
WELCOME="yes"
efe9b52
PROCEED="yes"
46b1063
UPLOAD="ask"
efe9b52
REPEAT=""
efe9b52
while [ -z "$REPEAT" ]; do
efe9b52
REPEAT="no"
efe9b52
case "$1" in
efe9b52
	--update|--help|--about)
46b1063
		WELCOME="no"
efe9b52
		PROCEED="no"
efe9b52
		;;
46b1063
	--upload)
46b1063
		UPLOAD="yes"
46b1063
		WELCOME="no"
46b1063
		;;
efe9b52
	--no-upload)
46b1063
		UPLOAD="no"
46b1063
		WELCOME="no"
efe9b52
		;;
1e0bef8
	--pastebin)
1e0bef8
		PASTEBIN="yes"
1e0bef8
		WWWSERVICE="pastebin"
1e0bef8
		;;
efe9b52
	--no-dialog)
efe9b52
		DIALOG=""
efe9b52
		REPEAT=""
efe9b52
		shift
efe9b52
		;;
bbe9f6c
	--stdout)
bbe9f6c
		DIALOG=""
46b1063
		UPLOAD="no"
46b1063
		WELCOME="no"
bbe9f6c
		TOSTDOUT="yes"
bbe9f6c
		;;
efe9b52
esac
efe9b52
done
efe9b52
efe9b52
46b1063
#Script header output.
46b1063
if [ "$WELCOME" = "yes" ]; then
46b1063
greeting_message="\
46b1063
46b1063
This script visits the following commands/files to collect diagnostic
46b1063
information about your ALSA installation and sound related hardware.
46b1063
46b1063
  dmesg
46b1063
  lspci
46b1063
  lsmod
46b1063
  aplay
46b1063
  amixer
46b1063
  alsactl
46b1063
  /proc/asound/
46b1063
  /sys/class/sound/
46b1063
  ~/.asoundrc (etc.)
46b1063
46b1063
See '$0 --help' for command line options.
46b1063
"
46b1063
if [[ -n "$DIALOG" ]]; then
46b1063
	dialog  --backtitle "$BGTITLE" \
46b1063
		--title "ALSA-Info script v $SCRIPT_VERSION" \
46b1063
		--msgbox "$greeting_message" 20 80
efe9b52
else
46b1063
	echo "ALSA Information Script v $SCRIPT_VERSION"
46b1063
	echo "--------------------------------"
46b1063
	echo "$greeting_message"
46b1063
fi # dialog
46b1063
fi # WELCOME
efe9b52
efe9b52
#Set the output file
46b1063
TEMPDIR=`mktemp -t -d alsa-info.XXXXXXXXXX` || exit 1
2a14aae
FILE="$TEMPDIR/alsa-info.txt"
46b1063
if [ -z "$NFILE" ]; then
46b1063
	NFILE=`mktemp -t alsa-info.txt.XXXXXXXXXX` || exit 1
46b1063
fi
efe9b52
bbe9f6c
trap cleanup 0
bbe9f6c
efe9b52
if [ "$PROCEED" = "yes" ]; then
efe9b52
efe9b52
if [[ -z "$LSPCI" ]] 
bbe9f6c
then
efe9b52
	echo "This script requires lspci. Please install it, and re-run this script."
bbe9f6c
	exit 0
efe9b52
fi
efe9b52
efe9b52
#Fetch the info and store in temp files/variables
a657df4
DISTRO=`grep -ihs "buntu\|SUSE\|Fedora\|PCLinuxOS\|MEPIS\|Mandriva\|Debian\|Damn\|Sabayon\|Slackware\|KNOPPIX\|Gentoo\|Zenwalk\|Mint\|Kubuntu\|FreeBSD\|Puppy\|Freespire\|Vector\|Dreamlinux\|CentOS\|Arch\|Xandros\|Elive\|SLAX\|Red\|BSD\|KANOTIX\|Nexenta\|Foresight\|GeeXboX\|Frugalware\|64\|SystemRescue\|Novell\|Solaris\|BackTrack\|KateOS\|Pardus" /etc/{issue,*release,*version}`
efe9b52
KERNEL_VERSION=`uname -r`
efe9b52
KERNEL_PROCESSOR=`uname -p`
efe9b52
KERNEL_MACHINE=`uname -m`
efe9b52
KERNEL_OS=`uname -o`
efe9b52
[[ `uname -v |grep SMP`  ]] && KERNEL_SMP="Yes" || KERNEL_SMP="No" 
efe9b52
ALSA_DRIVER_VERSION=`cat /proc/asound/version |head -n1|awk {'print $7'} |sed 's/\.$//'`
bbe9f6c
get_alsa_library_version
efe9b52
ALSA_UTILS_VERSION=`amixer -v |awk {'print $3'}`
2a14aae
VENDOR_ID=`lspci -vn |grep 040[1-3] | awk -F':' '{print $3}'|awk {'print substr($0, 2);}' >$TEMPDIR/vendor_id.tmp`
2a14aae
DEVICE_ID=`lspci -vn |grep 040[1-3] | awk -F':' '{print $4}'|awk {'print $1'} >$TEMPDIR/device_id.tmp`
efe9b52
LAST_CARD=$((`grep "]: " /proc/asound/cards | wc -l` - 1 ))
2a14aae
2a14aae
ESDINST=$(which esd 2>/dev/null| sed 's|^[^/]*||' 2>/dev/null)
2a14aae
PAINST=$(which pulseaudio 2>/dev/null| sed 's|^[^/]*||' 2>/dev/null)
2a14aae
ARTSINST=$(which artsd 2>/dev/null| sed 's|^[^/]*||' 2>/dev/null)
bbe9f6c
JACKINST=$(which jackd 2>/dev/null| sed 's|^[^/]*||' 2>/dev/null)
46b1063
DMIDECODE=$(which dmidecode 2>/dev/null| sed 's|^[^/]*||' 2>/dev/null)
46b1063
46b1063
#Check for DMI data
46b1063
if [ -d /sys/class/dmi/id ]; then
46b1063
    # No root privileges are required when using sysfs method
46b1063
    DMI_SYSTEM_MANUFACTURER=$(cat /sys/class/dmi/id/sys_vendor 2>/dev/null)
46b1063
    DMI_SYSTEM_PRODUCT_NAME=$(cat /sys/class/dmi/id/product_name 2>/dev/null)
Jaroslav Kysela 71ac133
    DMI_SYSTEM_PRODUCT_VERSION=$(cat /sys/class/dmi/id/product_version 2>/dev/null)
46b1063
elif [ -x $DMIDECODE ]; then
46b1063
    DMI_SYSTEM_MANUFACTURER=$($DMIDECODE -s system-manufacturer 2>/dev/null)
46b1063
    DMI_SYSTEM_PRODUCT_NAME=$($DMIDECODE -s system-product-name 2>/dev/null)
Jaroslav Kysela 71ac133
    DMI_SYSTEM_PRODUCT_VERSION=$($DMIDECODE -s system-version 2>/dev/null)
46b1063
fi
2a14aae
2a14aae
cat /proc/asound/modules 2>/dev/null|awk {'print $2'}>$TEMPDIR/alsamodules.tmp
2a14aae
cat /proc/asound/cards >$TEMPDIR/alsacards.tmp
2a14aae
lspci |grep -i "multi\|audio">$TEMPDIR/lspci.tmp
efe9b52
efe9b52
#Check for HDA-Intel cards codec#*
2a14aae
cat /proc/asound/card*/codec\#* > $TEMPDIR/alsa-hda-intel.tmp 2> /dev/null
efe9b52
efe9b52
#Check for AC97 cards codec
2a14aae
cat /proc/asound/card*/codec97\#0/ac97\#0-0 > $TEMPDIR/alsa-ac97.tmp 2> /dev/null
2a14aae
cat /proc/asound/card*/codec97\#0/ac97\#0-0+regs > $TEMPDIR/alsa-ac97-regs.tmp 2> /dev/null
efe9b52
ca0aa57
#Check for USB mixer setup
ca0aa57
cat /proc/asound/card*/usbmixer > $TEMPDIR/alsa-usbmixer.tmp 2> /dev/null
ca0aa57
efe9b52
#Fetch the info, and put it in $FILE in a nice readable format.
1e0bef8
if [[ -z $PASTEBIN ]]; then
1e0bef8
echo "upload=true&script=true&cardinfo=" > $FILE
1e0bef8
else
efe9b52
echo "name=$USER&type=33&description=/tmp/alsa-info.txt&expiry=&s=Submit+Post&content=" > $FILE
1e0bef8
fi
efe9b52
echo "!!################################" >> $FILE
efe9b52
echo "!!ALSA Information Script v $SCRIPT_VERSION" >> $FILE
efe9b52
echo "!!################################" >> $FILE
efe9b52
echo "" >> $FILE
2a14aae
echo "!!Script ran on: `LANG=C TZ=UTC date`" >> $FILE
efe9b52
echo "" >> $FILE
efe9b52
echo "" >> $FILE
efe9b52
echo "!!Linux Distribution" >> $FILE
efe9b52
echo "!!------------------" >> $FILE
efe9b52
echo "" >> $FILE
efe9b52
echo $DISTRO >> $FILE
efe9b52
echo "" >> $FILE
efe9b52
echo "" >> $FILE
46b1063
echo "!!DMI Information" >> $FILE
46b1063
echo "!!---------------" >> $FILE
46b1063
echo "" >> $FILE
46b1063
echo "Manufacturer:      $DMI_SYSTEM_MANUFACTURER" >> $FILE
46b1063
echo "Product Name:      $DMI_SYSTEM_PRODUCT_NAME" >> $FILE
Jaroslav Kysela 71ac133
echo "Product Version:   $DMI_SYSTEM_PRODUCT_VERSION" >> $FILE
46b1063
echo "" >> $FILE
46b1063
echo "" >> $FILE
efe9b52
echo "!!Kernel Information" >> $FILE
efe9b52
echo "!!------------------" >> $FILE
efe9b52
echo "" >> $FILE
efe9b52
echo "Kernel release:    $KERNEL_VERSION" >> $FILE
efe9b52
echo "Operating System:  $KERNEL_OS" >> $FILE
efe9b52
echo "Architecture:      $KERNEL_MACHINE" >> $FILE
efe9b52
echo "Processor:         $KERNEL_PROCESSOR" >> $FILE
efe9b52
echo "SMP Enabled:       $KERNEL_SMP" >> $FILE
efe9b52
echo "" >> $FILE
efe9b52
echo "" >> $FILE
efe9b52
echo "!!ALSA Version" >> $FILE
efe9b52
echo "!!------------" >> $FILE
efe9b52
echo "" >> $FILE
efe9b52
echo "Driver version:     $ALSA_DRIVER_VERSION" >> $FILE
efe9b52
echo "Library version:    $ALSA_LIB_VERSION" >> $FILE
efe9b52
echo "Utilities version:  $ALSA_UTILS_VERSION" >> $FILE
efe9b52
echo "" >> $FILE
efe9b52
echo "" >> $FILE
efe9b52
echo "!!Loaded ALSA modules" >> $FILE
efe9b52
echo "!!-------------------" >> $FILE
efe9b52
echo "" >> $FILE
2a14aae
cat $TEMPDIR/alsamodules.tmp >> $FILE
2a14aae
echo "" >> $FILE
2a14aae
echo "" >> $FILE
2a14aae
echo "!!Sound Servers on this system" >> $FILE
2a14aae
echo "!!----------------------------" >> $FILE
2a14aae
echo "" >> $FILE
2a14aae
if [[ -n $PAINST ]];then
bbe9f6c
[[ `pgrep '^(.*/)?pulseaudio$'` ]] && PARUNNING="Yes" || PARUNNING="No"
2a14aae
echo "Pulseaudio:" >> $FILE
2a14aae
echo "      Installed - Yes ($PAINST)" >> $FILE
2a14aae
echo "      Running - $PARUNNING" >> $FILE
efe9b52
echo "" >> $FILE
2a14aae
fi
2a14aae
if [[ -n $ESDINST ]];then
bbe9f6c
[[ `pgrep '^(.*/)?esd$'` ]] && ESDRUNNING="Yes" || ESDRUNNING="No"
2a14aae
echo "ESound Daemon:" >> $FILE
2a14aae
echo "      Installed - Yes ($ESDINST)" >> $FILE
2a14aae
echo "      Running - $ESDRUNNING" >> $FILE
2a14aae
echo "" >> $FILE
2a14aae
fi
2a14aae
if [[ -n $ARTSINST ]];then
bbe9f6c
[[ `pgrep '^(.*/)?artsd$'` ]] && ARTSRUNNING="Yes" || ARTSRUNNING="No"
2a14aae
echo "aRts:" >> $FILE
2a14aae
echo "      Installed - Yes ($ARTSINST)" >> $FILE
2a14aae
echo "      Running - $ARTSRUNNING" >> $FILE
2a14aae
echo "" >> $FILE
2a14aae
fi
bbe9f6c
if [[ -n $JACKINST ]];then
bbe9f6c
[[ `pgrep '^(.*/)?jackd$'` ]] && JACKRUNNING="Yes" || JACKRUNNING="No"
bbe9f6c
echo "Jack:" >> $FILE
bbe9f6c
echo "      Installed - Yes ($JACKINST)" >> $FILE
bbe9f6c
echo "      Running - $JACKRUNNING" >> $FILE
bbe9f6c
echo "" >> $FILE
bbe9f6c
fi
bbe9f6c
if [[ -z "$PAINST" && -z "$ESDINST" && -z "$ARTSINST" && -z "$JACKINST" ]];then
2a14aae
echo "No sound servers found." >> $FILE
2a14aae
echo "" >> $FILE
2a14aae
fi
efe9b52
echo "" >> $FILE
efe9b52
echo "!!Soundcards recognised by ALSA" >> $FILE
efe9b52
echo "!!-----------------------------" >> $FILE
efe9b52
echo "" >> $FILE
2a14aae
cat $TEMPDIR/alsacards.tmp >> $FILE
efe9b52
echo "" >> $FILE
efe9b52
echo "" >> $FILE
efe9b52
echo "!!PCI Soundcards installed in the system" >> $FILE
efe9b52
echo "!!--------------------------------------" >> $FILE
efe9b52
echo "" >> $FILE
2a14aae
cat $TEMPDIR/lspci.tmp >> $FILE
efe9b52
echo "" >> $FILE
efe9b52
echo "" >> $FILE
Jaroslav Kysela 71ac133
echo "!!Advanced information - PCI Vendor/Device/Subsystem ID's" >> $FILE
efe9b52
echo "!!--------------------------------------------------------" >> $FILE
efe9b52
echo "" >> $FILE
efe9b52
lspci -vvn |grep -A1 040[1-3] >> $FILE
efe9b52
echo "" >> $FILE
efe9b52
echo "" >> $FILE
efe9b52
efe9b52
if [ "$SNDOPTIONS" ]
efe9b52
then
efe9b52
echo "!!Modprobe options (Sound related)" >> $FILE
efe9b52
echo "!!--------------------------------" >> $FILE
efe9b52
echo "" >> $FILE
efe9b52
modprobe -c|sed -n 's/^options \(snd[-_][^ ]*\)/\1:/p' >> $FILE
efe9b52
echo "" >> $FILE
efe9b52
echo "" >> $FILE
efe9b52
fi
efe9b52
6817025
if [ -d "$SYSFS" ]
efe9b52
then
efe9b52
echo "!!Loaded sound module options" >> $FILE
efe9b52
echo "!!--------------------------" >> $FILE
efe9b52
echo "" >> $FILE
efe9b52
for mod in `cat /proc/asound/modules|awk {'print $2'}`;do
efe9b52
echo "!!Module: $mod" >> $FILE
46b1063
for params in `echo $SYSFS/module/$mod/parameters/*`; do
46b1063
	echo -ne "\t";
46b1063
	echo "$params : `cat $params`" | sed 's:.*/::';
46b1063
done >> $FILE
efe9b52
echo "" >> $FILE
efe9b52
done
efe9b52
echo "" >> $FILE
efe9b52
fi
efe9b52
2a14aae
if [ -s "$TEMPDIR/alsa-hda-intel.tmp" ] 
efe9b52
then
efe9b52
	echo "!!HDA-Intel Codec information" >> $FILE
efe9b52
	echo "!!---------------------------" >> $FILE
efe9b52
	echo "--startcollapse--" >> $FILE
efe9b52
	echo "" >> $FILE
2a14aae
	cat $TEMPDIR/alsa-hda-intel.tmp >> $FILE
efe9b52
	echo "--endcollapse--" >> $FILE
efe9b52
	echo "" >> $FILE
efe9b52
	echo "" >> $FILE
efe9b52
fi
efe9b52
2a14aae
if [ -s "$TEMPDIR/alsa-ac97.tmp" ]
efe9b52
then
efe9b52
        echo "!!AC97 Codec information" >> $FILE
efe9b52
        echo "!!---------------------------" >> $FILE
efe9b52
        echo "--startcollapse--" >> $FILE
efe9b52
        echo "" >> $FILE
2a14aae
        cat $TEMPDIR/alsa-ac97.tmp >> $FILE
efe9b52
        echo "" >> $FILE
2a14aae
        cat $TEMPDIR/alsa-ac97-regs.tmp >> $FILE
efe9b52
        echo "--endcollapse--" >> $FILE
efe9b52
	echo "" >> $FILE
efe9b52
	echo "" >> $FILE
efe9b52
fi
efe9b52
ca0aa57
if [ -s "$TEMPDIR/alsa-usbmixer.tmp" ]
ca0aa57
then
ca0aa57
        echo "!!USB Mixer information" >> $FILE
ca0aa57
        echo "!!---------------------------" >> $FILE
ca0aa57
        echo "--startcollapse--" >> $FILE
ca0aa57
        echo "" >> $FILE
ca0aa57
        cat $TEMPDIR/alsa-usbmixer.tmp >> $FILE
ca0aa57
        echo "--endcollapse--" >> $FILE
ca0aa57
	echo "" >> $FILE
ca0aa57
	echo "" >> $FILE
ca0aa57
fi
efe9b52
efe9b52
#If no command line options are specified, then run as though --with-all was specified
efe9b52
if [[ -z "$1" ]]
efe9b52
then
efe9b52
	update
46b1063
	withall
a657df4
	pbcheck	
efe9b52
fi
efe9b52
efe9b52
fi # proceed
efe9b52
efe9b52
#loop through command line arguments, until none are left.
efe9b52
if [[ -n "$1" ]]
efe9b52
then
efe9b52
	until [ -z "$1" ]
efe9b52
	do
efe9b52
	case "$1" in
1e0bef8
		--pastebin)
1e0bef8
		        update
46b1063
			withall
1e0bef8
        		pbcheck
1e0bef8
			;;
efe9b52
		--update)
efe9b52
			update
efe9b52
			exit
efe9b52
			;;
46b1063
		--upload)
46b1063
			UPLOAD="yes"
46b1063
			withall
46b1063
			;;
efe9b52
		--no-upload)
46b1063
			UPLOAD="no"
46b1063
			withall
46b1063
			;;
46b1063
		--output)
46b1063
			shift
46b1063
			NFILE="$1"
46b1063
			KEEP_OUTPUT="yes"
efe9b52
			;;
efe9b52
		--debug)
efe9b52
			echo "Debugging enabled. $FILE and $TEMPDIR will not be deleted"
efe9b52
			KEEP_FILES="yes"
efe9b52
			echo ""
46b1063
			withall
efe9b52
			;;
efe9b52
		--with-all)
46b1063
			withall
efe9b52
			;;
efe9b52
		--with-aplay)
efe9b52
			withaplay
efe9b52
			;;
efe9b52
		--with-amixer)
efe9b52
			withamixer
efe9b52
			;;
efe9b52
		--with-alsactl)
efe9b52
			withalsactl
efe9b52
			;;
efe9b52
		--with-devices)
efe9b52
			withdevices
efe9b52
			;;
46b1063
		--with-dmesg)
46b1063
			withdmesg
46b1063
			;;
efe9b52
		--with-configs)
efe9b52
			if [[ -e $HOME/.asoundrc ]] || [[ -e /etc/asound.conf ]]
efe9b52
			then
efe9b52
				echo "!!ALSA configuration files" >> $FILE
efe9b52
				echo "!!------------------------" >> $FILE
efe9b52
				echo "" >> $FILE
efe9b52
efe9b52
				#Check for ~/.asoundrc
efe9b52
				if [[ -e $HOME/.asoundrc ]]
efe9b52
				then
efe9b52
					echo "!!User specific config file ($HOME/.asoundrc)" >> $FILE
efe9b52
					echo "" >> $FILE
efe9b52
					cat $HOME/.asoundrc >> $FILE
efe9b52
					echo "" >> $FILE
efe9b52
					echo "" >> $FILE
efe9b52
				fi
efe9b52
efe9b52
				#Check for /etc/asound.conf
efe9b52
				if [[ -e /etc/asound.conf ]]
efe9b52
				then
efe9b52
					echo "!!System wide config file (/etc/asound.conf)" >> $FILE
efe9b52
					echo "" >> $FILE
efe9b52
					cat /etc/asound.conf >> $FILE
efe9b52
					echo "" >> $FILE
efe9b52
					echo "" >> $FILE
efe9b52
				fi
efe9b52
			fi
efe9b52
			;;
bbe9f6c
		--stdout)
46b1063
			UPLOAD="no"
46b1063
			withall
bbe9f6c
			cat $FILE
bbe9f6c
			rm $FILE
bbe9f6c
			;;
efe9b52
		--about)
efe9b52
			echo "Written/Tested by the following users of #alsa on irc.freenode.net:"
efe9b52
			echo ""
efe9b52
			echo "	wishie - Script author and developer / Testing"
efe9b52
			echo "	crimsun - Various script ideas / Testing"
efe9b52
			echo "	gnubien - Various script ideas / Testing"
efe9b52
			echo "	GrueMaster - HDA Intel specific items / Testing"
efe9b52
			echo "	olegfink - Script update function"
bbe9f6c
			echo "  TheMuso - display to stdout functionality"
efe9b52
			exit 0
efe9b52
			;;
efe9b52
		*)
1e0bef8
			echo "alsa-info.sh version $SCRIPT_VERSION"
efe9b52
			echo ""
efe9b52
			echo "Available options:"
efe9b52
			echo "	--with-aplay (includes the output of aplay -l)"
efe9b52
			echo "	--with-amixer (includes the output of amixer)"
efe9b52
			echo "	--with-alsactl (includes the output of alsactl)"
1e0bef8
			echo "	--with-configs (includes the output of ~/.asoundrc and"
1e0bef8
			echo "	    /etc/asound.conf if they exist)" 
efe9b52
			echo "	--with-devices (shows the device nodes in /dev/snd/)"
46b1063
			echo "	--with-dmesg (shows the ALSA/HDA kernel messages)"
efe9b52
			echo ""
46b1063
			echo "	--output FILE (specify the file to output for no-upload mode)"
efe9b52
			echo "	--update (check server for script updates)"
46b1063
			echo "	--upload (upload contents to remote server)"
efe9b52
			echo "	--no-upload (do not upload contents to remote server)"
1e0bef8
			echo "	--pastebin (use http://pastebin.ca) as remote server"
1e0bef8
			echo "	    instead www.alsa-project.org"
46b1063
			echo "	--stdout (print alsa information to standard output"
46b1063
			echo "	    instead of a file)"
efe9b52
			echo "	--about (show some information about the script)"
1e0bef8
			echo "	--debug (will run the script as normal, but will not"
1e0bef8
			echo "	     delete $FILE)"
efe9b52
			exit 0
efe9b52
			;;
efe9b52
	esac
efe9b52
	shift 1
efe9b52
	done
efe9b52
fi
efe9b52
bbe9f6c
if [ "$PROCEED" = "no" ]; then
bbe9f6c
	exit 1
bbe9f6c
fi
bbe9f6c
46b1063
if [ "$UPLOAD" = "ask" ]; then
46b1063
	if [[ -n "$DIALOG" ]]; then
46b1063
		dialog --backtitle "$BGTITLE" --title "Information collected" --yes-label " UPLOAD / SHARE " --no-label " SAVE LOCALLY " --defaultno --yesno "\n\nAutomatically upload ALSA information to $WWWSERVICE?" 10 80
46b1063
		DIALOG_EXIT_CODE=$?
46b1063
		if [ $DIALOG_EXIT_CODE != 0 ]; then
46b1063
			UPLOAD="no"
46b1063
		else
46b1063
			UPLOAD="yes"
46b1063
		fi
46b1063
	else
46b1063
		echo -n "Automatically upload ALSA information to $WWWSERVICE? [y/N] : "
46b1063
		read -e CONFIRM
46b1063
		if [ "$CONFIRM" != "y" ]; then
46b1063
			UPLOAD="no"
46b1063
		else
46b1063
			UPLOAD="yes"
46b1063
		fi
46b1063
	fi
46b1063
46b1063
fi
46b1063
46b1063
if [ "$UPLOAD" = "no" ]; then
bbe9f6c
bbe9f6c
	if [ -z "$TOSTDOUT" ]; then
46b1063
		mv -f $FILE $NFILE || exit 1
46b1063
		KEEP_OUTPUT="yes"
bbe9f6c
	fi
bbe9f6c
bbe9f6c
	if [[ -n $DIALOG ]]
bbe9f6c
	then
bbe9f6c
		if [[ -n $PBERROR ]]; then
46b1063
			dialog --backtitle "$BGTITLE" --title "Information collected" --msgbox "An error occurred while contacting the $WWWSERVICE.\n Your information was NOT automatically uploaded.\n\nYour ALSA information is in $NFILE" 10 100
bbe9f6c
		else
46b1063
			dialog --backtitle "$BGTITLE" --title "Information collected" --msgbox "\n\nYour ALSA information is in $NFILE" 10 60
bbe9f6c
		fi
bbe9f6c
	else
bbe9f6c
		echo
bbe9f6c
bbe9f6c
		if [[ -n $PBERROR ]]; then
46b1063
			echo "An error occurred while contacting the $WWWSERVICE."
46b1063
			echo "Your information was NOT automatically uploaded."
bbe9f6c
			echo ""
46b1063
			echo "Your ALSA information is in $NFILE"
bbe9f6c
			echo ""
bbe9f6c
		else
bbe9f6c
			if [ -z "$TOSTDOUT" ]; then
bbe9f6c
				echo ""
46b1063
				echo "Your ALSA information is in $NFILE"
bbe9f6c
				echo ""
bbe9f6c
			fi
bbe9f6c
		fi
bbe9f6c
	fi
bbe9f6c
bbe9f6c
	exit
bbe9f6c
46b1063
fi # UPLOAD
efe9b52
efe9b52
#Test that wget is installed, and supports --post-file. Upload $FILE if it does, and prompt user to upload file if it doesnt. 
efe9b52
if
efe9b52
WGET=$(which wget 2>/dev/null| sed 's|^[^/]*||' 2>/dev/null); [[ -n "${WGET}" ]] && [[ -x "${WGET}" ]] && [[ `wget --help |grep post-file` ]]
efe9b52
then
bbe9f6c
bbe9f6c
if [[ -n $DIALOG ]]
efe9b52
then
bbe9f6c
bbe9f6c
if [[ -z $PASTEBIN ]]; then
2a14aae
	wget -O - --tries=5 --timeout=60 --post-file=$FILE "http://www.alsa-project.org/cardinfo-db/" &>$TEMPDIR/wget.tmp || echo "Upload failed; exit"
1e0bef8
	{ for i in 10 20 30 40 50 60 70 80 90; do
1e0bef8
		echo $i
1e0bef8
		sleep 0.2
1e0bef8
	done
1e0bef8
	echo; } |dialog --backtitle "$BGTITLE" --guage "Uploading information to www.alsa-project.org ..." 6 70 0
bbe9f6c
else
2a14aae
	wget -O - --tries=5 --timeout=60 --post-file=$FILE "http://pastebin.ca/quiet-paste.php?api=$PASTEBINKEY&encrypt=t&encryptpw=blahblah" &>$TEMPDIR/wget.tmp || echo "Upload failed; exit"
efe9b52
	{ for i in 10 20 30 40 50 60 70 80 90; do
efe9b52
		echo $i
efe9b52
		sleep 0.2
efe9b52
	done
efe9b52
	echo; } |dialog --backtitle "$BGTITLE" --guage "Uploading information to www.pastebin.ca ..." 6 70 0
bbe9f6c
fi
bbe9f6c
bbe9f6c
dialog --backtitle "$BGTITLE" --title "Information uploaded" --yesno "Would you like to see the uploaded information?" 5 100 
bbe9f6c
DIALOG_EXIT_CODE=$?
bbe9f6c
if [ $DIALOG_EXIT_CODE = 0 ]; then
bbe9f6c
	grep -v "alsa-info.txt" $FILE >$TEMPDIR/uploaded.txt
bbe9f6c
	dialog --backtitle "$BGTITLE" --textbox $TEMPDIR/uploaded.txt 0 0
bbe9f6c
fi
bbe9f6c
bbe9f6c
clear
bbe9f6c
bbe9f6c
# no dialog
efe9b52
else
efe9b52
bbe9f6c
if [[ -z $PASTEBIN ]]; then
1e0bef8
	echo -n "Uploading information to www.alsa-project.org ... " 
2a14aae
	wget -O - --tries=5 --timeout=60 --post-file=$FILE http://www.alsa-project.org/cardinfo-db/ &>$TEMPDIR/wget.tmp &
bbe9f6c
else
efe9b52
	echo -n "Uploading information to www.pastebin.ca ... " 
2a14aae
	wget -O - --tries=5 --timeout=60 --post-file=$FILE http://pastebin.ca/quiet-paste.php?api=$PASTEBINKEY &>$TEMPDIR/wget.tmp &
efe9b52
fi
bbe9f6c
efe9b52
#Progess spinner for wget transfer.
bbe9f6c
i=1
bbe9f6c
sp="/-\|"
bbe9f6c
echo -n ' '
bbe9f6c
while pgrep wget &>/dev/null
bbe9f6c
do
efe9b52
	echo -en "\b${sp:i++%${#sp}:1}"
bbe9f6c
done
bbe9f6c
bbe9f6c
echo -e "\b Done!"
bbe9f6c
echo ""
bbe9f6c
bbe9f6c
fi #dialog
efe9b52
efe9b52
#See if tput is available, and use it if it is.	
bbe9f6c
if [[ -n "$TPUT" ]]
efe9b52
then
bbe9f6c
	if [[ -z $PASTEBIN ]]; then
bbe9f6c
		FINAL_URL=`tput setaf 1; grep "SUCCESS:" $TEMPDIR/wget.tmp | cut -d ' ' -f 2 ; tput sgr0`
efe9b52
	else
bbe9f6c
		FINAL_URL=`tput setaf 1; grep "SUCCESS:" $TEMPDIR/wget.tmp |sed -n 's/.*\:\([0-9]\+\).*/http:\/\/pastebin.ca\/\1/p';tput sgr0`
efe9b52
	fi
bbe9f6c
else
bbe9f6c
	if [[ -z $PASTEBIN ]]; then
bbe9f6c
		FINAL_URL=`grep "SUCCESS:" $TEMPDIR/wget.tmp | cut -d ' ' -f 2`
a657df4
	else
bbe9f6c
		FINAL_URL=`grep "SUCCESS:" $TEMPDIR/wget.tmp |sed -n 's/.*\:\([0-9]\+\).*/http:\/\/pastebin.ca\/\1/p'`
a657df4
	fi
efe9b52
fi
bbe9f6c
bbe9f6c
#Output the URL of the uploaded file.	
efe9b52
echo "Your ALSA information is located at $FINAL_URL"
efe9b52
echo "Please inform the person helping you."
efe9b52
echo ""
efe9b52
efe9b52
#We couldnt find a suitable wget, so tell the user to upload manually.
efe9b52
else
46b1063
	mv -f $FILE $NFILE || exit 1
46b1063
	KEEP_OUTPUT="yes"
efe9b52
	if [[ -z $DIALOG ]]
efe9b52
	then
1e0bef8
		if [[ -z $PASTEBIN ]]; then
1e0bef8
		echo ""
1e0bef8
		echo "Could not automatically upload output to http://www.alsa-project.org"
1e0bef8
		echo "Possible reasons are:"
1e0bef8
		echo "    1. Couldnt find 'wget' in your PATH"
1e0bef8
		echo "    2. Your version of wget is less than 1.8.2"
1e0bef8
		echo ""
2a14aae
		echo "Please manually upload $NFILE to http://www.alsa-project.org/cardinfo-db/ and submit your post."
1e0bef8
		echo ""
1e0bef8
		else
efe9b52
		echo ""
efe9b52
		echo "Could not automatically upload output to http://www.pastebin.ca"
efe9b52
		echo "Possible reasons are:"
efe9b52
		echo "    1. Couldnt find 'wget' in your PATH"
efe9b52
		echo "    2. Your version of wget is less than 1.8.2"
efe9b52
		echo ""
2a14aae
		echo "Please manually upload $NFILE to http://www.pastebin.ca/upload.php and submit your post."
efe9b52
		echo ""
1e0bef8
		fi
bbe9f6c
	else
1e0bef8
		if [[ -z $PASTEBIN ]]; then
2a14aae
			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 $NFILE to http://www.alsa-project,org/cardinfo-db/ and submit your post." 25 100
1e0bef8
		else
2a14aae
			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 $NFILE to http://www.pastebin.ca/upload.php and submit your post." 25 100
1e0bef8
		fi
efe9b52
	fi
efe9b52
fi
efe9b52
bbe9f6c