[Pkg-alsa-devel] [Debian ALSA CVS] debian/alsa-driver/debian (alsa-base.init)

Thomas Hood jdthood-guest@haydn.debian.org
Thu, 09 Sep 2004 07:12:09 -0600


    Date: Thursday, September 9, 2004 @ 07:12:09
  Author: jdthood-guest
    Path: /cvsroot/pkg-alsa/debian/alsa-driver/debian

Modified: alsa-base.init

Clean up initscript a bit more


----------------+
 alsa-base.init |   36 +++++++++++++++++++++---------------
 1 files changed, 21 insertions(+), 15 deletions(-)


Index: debian/alsa-driver/debian/alsa-base.init
diff -u debian/alsa-driver/debian/alsa-base.init:1.54 debian/alsa-driver/debian/alsa-base.init:1.55
--- debian/alsa-driver/debian/alsa-base.init:1.54	Wed Sep  8 07:57:23 2004
+++ debian/alsa-driver/debian/alsa-base.init	Thu Sep  9 07:12:07 2004
@@ -40,15 +40,7 @@
 	fi
 }
 
-start()
-{
-	printf "Starting ALSA..."
-	#restore_mixer_settings
-	echo "done."
-	return 0
-}
-
-stop()
+store_mixer_settings_if_allowed()
 {
 	if [ "$alsactl_store_on_shutdown" != "never autosave" ]; then
 		if runlevel | grep -E "^$runlevels_save " > /dev/null 2>&1 \
@@ -67,6 +59,20 @@
 	fi
 }
 
+start()
+{
+	printf "Starting ALSA..."
+	#restore_mixer_settings || return 1
+	echo "done."
+	return 0
+}
+
+stop()
+{
+	store_mixer_settings_if_allowed || return 1
+	return 0
+}
+
 force_stop()
 {
 	set_procs_using_sound() {
@@ -95,7 +101,7 @@
 		fi
 		echo "done."
 	fi
-	stop || :
+	store_mixer_settings_if_allowed || :
 	rmmod=""
 	case "$(modprobe --version 2>&1)" in
 		modprobe*) rmmod="rmmod -r" ;;
@@ -117,13 +123,13 @@
 case "$1" in
 	start) start ;;
 	stop) stop ;;
-	restart) stop ; start ;;
-	reload) stop && start ;;
+	restart) stop || : ; start ;;
+	reload) stop || : ; start ;;
 	force-stop) force_stop ;;
-	force-restart) force_stop ; start ;;
-	force-reload) force-stop && start ;;
+	force-restart) force_stop || : ; start ;;
+	force-reload) force-stop || : ; start ;;
 	*)
-	echo "Usage: /etc/init.d/alsa {start|stop|restart|reload|force-stop|force-reload}" >&2
+	echo "Usage: /etc/init.d/alsa {start|stop|restart|reload|force-stop|force-restart|force-reload}" >&2
 	exit 3
 	;;
 esac