named: conditionally copy files to chroot (rc-script)
[dragonfly.git] / etc / rc.d / mixer
index e185570..5af99ae 100644 (file)
@@ -20,7 +20,7 @@ mixer_start()
 {
        if [ -r $mixer_conf ]; then
                echo "Loading mixer settings"
-               cat $mixer_conf| xargs mixer 
+               xargs -L 1 mixer < $mixer_conf
        fi
 }
 
@@ -29,7 +29,10 @@ mixer_stop()
        [ -z "$mixer_conf" ] && return
        if [ -w $mixer_conf -o \( ! -e $mixer_conf -a -w `dirname $mixer_conf` \) ]; then
                echo "Storing mixer settings"
-               mixer -s > $mixer_conf
+               > $mixer_conf
+               for f in /dev/mixer[0-9]*; do
+                       printf "-f %s %s\n" "$f" "$(mixer -f "$f" -s)" >> $mixer_conf
+               done
        fi
 }