#!/bin/sh case $1 in drivers) . /etc/init.d/rc.functions setup_drivers "$(cd /lib/modules/$(uname -r)/kernel/sound; find . -name "snd-*.ko" -printf "%f\n" | sed 's/\.ko//')" ;; devices) . /etc/init.d/rc.functions if [ -n "$(aplay -l 2>/dev/null)" ]; then test "$ALSA_DEVICE" != "" && echo "$ALSA_DEVICE" test "$ALSA_DEVICE" != "auto" && echo "auto" echo "-" LC_ALL=C aplay -l | grep "^card " | sed "s/card \([0-9]\+\): .*, device \([0-9]\+\).* \[\(.*\)\]/\1 \2 \3/" else aplay -l 2>&1 >/dev/null | sed "s/.*:/--/" fi ;; esac