Merge from vendor branch SENDMAIL:
[dragonfly.git] / etc / rc.d / mixer
CommitLineData
7484ccd1
JS
1#!/bin/sh
2#
696a5717 3# $DragonFly: src/etc/rc.d/mixer,v 1.8 2005/11/19 21:47:32 swildner Exp $
7484ccd1
JS
4#
5
6# PROVIDE: mixer
a8ed1681
JS
7# REQUIRE: DAEMON
8# BEFORE: LOGIN
696a5717 9# KEYWORD: shutdown
7484ccd1
JS
10
11. /etc/rc.subr
12
13name="mixer"
7b2050d9 14rcvar=`set_rcvar`
7484ccd1
JS
15start_cmd="mixer_start"
16stop_cmd="mixer_stop"
17mixer_conf=/etc/mixer.conf
18
19mixer_start()
20{
21 if [ -r $mixer_conf ]; then
314935e8 22 echo "Loading mixer settings"
7484ccd1
JS
23 cat $mixer_conf| xargs mixer
24 fi
25}
26
27mixer_stop()
28{
29 [ -z "$mixer_conf" ] && return
30 if [ -w $mixer_conf -o \( ! -e $mixer_conf -a -w `dirname $mixer_conf` \) ]; then
314935e8
JS
31 echo "Storing mixer settings"
32 mixer -s > $mixer_conf
7484ccd1
JS
33 fi
34}
35
36load_rc_config $name
37run_rc_command "$1"