Files
ports/main/alsa-utils/rc.alsa
2021-05-12 08:11:10 +08:00

33 lines
459 B
Bash
Executable File

#!/bin/sh
#
# /etc/rc.d/alsa: store/restore ALSA mixer levels
#
. /etc/rc.subr
# location of the alsactl executable
ALSACTL=/usr/sbin/alsactl
case $1 in
start)
if [ -f /var/lib/alsa/asound.state ]; then
msg "Restoring ALSA volume state..."
$ALSACTL restore
fi
;;
stop)
msg "Saving ALSA volume state..."
$ALSACTL store
;;
restart)
$0 stop
sleep 2
$0 start
;;
*)
echo "Usage: $0 [start|stop|restart]"
;;
esac
# End of file