Quote:
Originally Posted by Carpetsmoker
Here is a script that will load the sound drivers one by one, detect which one you're using, and add it to /boot/loader.conf.
This will work on any version of FreeBSD.
Code:
#!/bin/sh
#
# Detect sound driver
for driver in /boot/kernel/snd_*; do
driver=$(echo ${driver} | sed 's|/boot/kernel/snd_||')
if [ ${driver} = "driver.ko" ]; then
continue;
fi
kldload snd_${driver}
if [ -c /dev/mixer0 ]; then
echo "I'm smelling 'snd_${driver}'"
echo "snd_${driver}_load=\"YES\"" >> /boot/loader.conf
exit 0
fi
kldunload snd_${driver}
done
|
Nice shell script. Any chance on seeing a "BSD Scripting 101" guide or a post with some useful tutorials?