3 # alsasave This shell script takes care of stopping ALSA sound driver.
5 # This script requires /usr/sbin/alsactl program from alsa-utils package.
7 # Copyright (c) by Jaroslav Kysela <perex@jcu.cz>
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2 of the License, or
12 # (at your option) any later version.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 # For PLD Linux Distribution:
25 # chkconfig: 2345 80 14
26 # description: ALSA driver
29 # Source function library.
30 . /etc/rc.d/init.d/functions
32 alsactl=/usr/sbin/alsactl
33 subsyslock=/var/lock/subsys/alsa-udev
37 # remove all sound modules
39 /sbin/lsmod | awk '/^snd/ { print $0 }' | while read line; do \
40 /sbin/rmmod `echo $line | cut -d ' ' -f 1`; \
48 # store driver settings
50 if [ -x $alsactl ]; then
53 show '!!!alsactl not found!!!'; fail
57 # See how we were called.
64 if [ -d /proc/asound ]; then
65 show "Shutting down sound driver"
67 if [ -f /proc/asound/detect ]; then
72 (rmmod isapnp; rmmod soundcore) 2> /dev/null
73 [ -f $subsyslock ] && rm $subsyslock
76 msg_not_running "ALSA driver"
86 msg_usage "$0 {start|stop|save|status}"