2002-06-02 22:36:46 +04:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2002-10-12 15:29:28 +04:00
|
|
|
# $NetBSD: mixerctl,v 1.5 2002/10/12 11:29:29 kent Exp $
|
2002-06-02 22:36:46 +04:00
|
|
|
#
|
|
|
|
|
|
|
|
# PROVIDE: mixerctl
|
2002-06-11 20:31:41 +04:00
|
|
|
# REQUIRE: mountcritremote
|
2002-10-12 15:29:28 +04:00
|
|
|
# KEYWORD: shutdown
|
2002-06-02 22:36:46 +04:00
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
|
|
|
name="mixerctl"
|
|
|
|
start_cmd="mixerctl_start"
|
2002-10-12 15:29:28 +04:00
|
|
|
stop_cmd="mixerctl_stop"
|
2002-06-02 22:36:46 +04:00
|
|
|
|
|
|
|
mixerctl_start()
|
|
|
|
{
|
2002-10-12 15:29:28 +04:00
|
|
|
if [ -n "$mixerctl_mixers" ]; then
|
|
|
|
echo -n "Restoring mixer settings:"
|
|
|
|
for mix in $mixerctl_mixers; do
|
|
|
|
if [ -s /var/db/${mix}.conf ]; then
|
|
|
|
echo -n " $mix"
|
|
|
|
/usr/bin/mixerctl -f /dev/$mix -n -w \
|
|
|
|
`/bin/cat /var/db/${mix}.conf`
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
echo "."
|
|
|
|
fi
|
2002-06-02 22:36:46 +04:00
|
|
|
if [ -r /etc/mixerctl.conf ]; then
|
|
|
|
echo "Setting mixerctl variables..."
|
2002-06-11 20:31:41 +04:00
|
|
|
while read setting; do
|
2002-10-12 15:29:28 +04:00
|
|
|
[ -z "$setting" ] || /usr/bin/mixerctl -n -w $setting
|
2002-06-11 20:31:41 +04:00
|
|
|
done < /etc/mixerctl.conf
|
2002-06-02 22:36:46 +04:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2002-10-12 15:29:28 +04:00
|
|
|
mixerctl_stop()
|
|
|
|
{
|
|
|
|
if [ -n "$mixerctl_mixers" ]; then
|
|
|
|
echo -n "Saving mixer settings:"
|
|
|
|
for mix in $mixerctl_mixers; do
|
|
|
|
echo -n " $mix"
|
|
|
|
/usr/bin/mixerctl -f /dev/$mix -a > /var/db/${mix}.conf
|
|
|
|
done
|
|
|
|
echo "."
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2002-06-02 22:36:46 +04:00
|
|
|
load_rc_config $name
|
|
|
|
run_rc_command "$1"
|