Kod: Zaznacz cały
#!/bin/bash
echo
# time and user
date=$(date)
echo "Today is $date"
me=$(whoami)
echo "Sound tested by $me"
echo
echo
echo "== Identifying System =="
uname -s -r -v -p -o
cat /proc/cpuinfo | grep -i "model name"
cat /proc/cpuinfo | grep -i "cpu mhz"
cat /proc/meminfo | grep -i memtotal
cat /proc/meminfo | grep -i swaptotal
echo
echo "== Information about a mixer device =="
amixer info
echo
echo "== Checking dsp devices =="
ls -l /dev | egrep -i dsp\|sound
echo
echo "== Checking mixer devices =="
ls -l /dev | egrep -i dsp\|mixer
echo
echo "== Checking Driver =="
if test -f /sbin/lspci
then /sbin/lspci -v | egrep -i "(audio|multimedia|host bridge)"
elif test -f /usr/bin/lspci
then /usr/bin/lspci -v | egrep -i "(audio|multimedia|host bridge)"
else
echo "==> Test not available on this system !"
fi
echo
echo "== ALSA version =="
cat /proc/asound/version
echo
echo "== Checking Actual Driver in Use (/etc/modprobe.d/sound) kernel 2.6 =="
if test -f /etc/modprobe.d/sound; then
cat /etc/modprobe.d/sound
else
echo "==> Test not available on this system !"
fi
echo
echo "== Checking Cross Platform Audio Output Library (/etc/libao.conf) =="
if test -f /etc/libao.conf; then
cat /etc/libao.conf | grep -E -v "^#| ^$"
else
echo "==> /etc/libao.conf not available !"
fi
echo
echo "== Checking ALSA configure files =="
if test -f /etc/asound.conf; then
echo "/etc/asound.conf ====> exist"
fi
if test -f $HOME/.asoundrc; then
echo -e "$HOME/.asoundrc ====> exist"
fi
if test -f $HOME/.asoundrc.asoundconf; then
echo -e "$HOME/.asoundrc.asoundconf ====> exist"
fi
echo
echo "== Checking esd config (/etc/esound/esd.conf) =="
if test -f /etc/esound/esd.conf; then
echo "-----------------------------------------------------"
cat /etc/esound/esd.conf | grep -E -v "^#| ^$"
echo "-----------------------------------------------------"
fi
if test -d /dev/snd; then
echo
echo "== Checking alsa /dev/snd =="
ls --color=none /dev/snd
fi
echo
echo "== Checking if Module Loaded =="
/sbin/lsmod | egrep -i snd\|sound\|audio\|game
echo
if test -x /usr/sbin/sysv-rc-conf; then
echo "== Checking in what level alsasound service is configured to run =="
if test -x /etc/init.d/alsasound; then
/usr/sbin/sysv-rc-conf --list alsasound
else
echo "Init script alsasound not exist !"
fi
echo
echo "== Checking in what level alsa-utils service is configured to run =="
if test -x /etc/init.d/alsa-utils; then
/usr/sbin/sysv-rc-conf --list alsa-utils
else
echo "Init script alsa-utils not exist !"
fi
else
echo "==> Test for run levels not available on this system !"
fi
echo
echo "== Checking if Sound Volume muted =="
if test -x /usr/bin/aumix; then
aumix -q
else
echo "==> Test not available on this system !"
fi
echo
echo "== Checking artsd setup =="
ps -A -f | grep -i artsd | grep -v grep
echo
echo "== Checking esd setup =="
ps -A -f | grep -i esd | grep -v grep
echo
echo "== Checking which program uses the sound card or cdrom =="
echo " (no output is okay)"
if test -x /sbin/fuser; then
/sbin/fuser -v /dev/dsp
/sbin/fuser -v /dev/cdrom
else
/bin/fuser -v /dev/dsp
/bin/fuser -v /dev/cdrom
fi
echo
echo "== Test wav file . . . . . please wait =="
if test -f /usr/share/sounds/startup.wav
then
/usr/bin/play /usr/share/sounds/startup.wav > /dev/null
else
echo "==> Test not available on this system !"
fi
# Interactive part
echo -n "Did you hear the soundfile Yes/No ?:"
read answer
# the user did not enter anything:
while [ -z "$answer" ]; do
echo "You did not tell me Yes or No !!!"
echo -n "Did you hear the soundfile Yes/No ?:"
read answer
done
echo "You typed: $answer Thanks !"
sleep 2
echo
echo "== End of Checks =="
echo