Sync usage with man page.
[netbsd-mini2440.git] / etc / rc.d / mixerctl
blobebf2997d58e5d254d06c0ac128730f562ed7329a
1 #!/bin/sh
3 # $NetBSD: mixerctl,v 1.9 2004/10/11 15:00:51 christos Exp $
6 # PROVIDE: mixerctl
7 # REQUIRE: mountcritremote
8 # KEYWORD: shutdown
10 $_rc_subr_loaded . /etc/rc.subr
12 name="mixerctl"
13 rcvar=$name
14 start_cmd="mixerctl_start"
15 stop_cmd="mixerctl_stop"
17 mixerctl_start()
19 if [ -n "$mixerctl_mixers" ]; then
20 echo -n "Restoring mixer settings:"
21 for mix in $mixerctl_mixers; do
22 if [ -s /var/db/${mix}.conf ]; then
23 echo -n " $mix"
24 /usr/bin/mixerctl -d /dev/$mix -n -w \
25 $(/bin/cat /var/db/${mix}.conf)
27 done
28 echo "."
30 if [ -r /etc/mixerctl.conf ]; then
31 echo "Setting mixerctl variables..."
32 while read setting; do
33 case "$setting" in
34 \#*|"")
35 continue
37 esac
38 /usr/bin/mixerctl -n -w $setting
39 done < /etc/mixerctl.conf
43 mixerctl_stop()
45 if [ -n "$mixerctl_mixers" ]; then
46 echo -n "Saving mixer settings:"
47 for mix in $mixerctl_mixers; do
48 echo -n " $mix"
49 /usr/bin/mixerctl -d /dev/$mix -a > /var/db/${mix}.conf
50 done
51 echo "."
55 load_rc_config $name
56 run_rc_command "$1"