]> git.pld-linux.org Git - packages/alsa-utils.git/commitdiff
- use functions to avoid reexec for restart
authorElan Ruusamäe <glen@pld-linux.org>
Sun, 17 Sep 2006 16:10:44 +0000 (16:10 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    alsasound.init -> 1.13

alsasound.init

index a3578144a2f83f4e8ef1ed0a8c8bbc4cf74bf5b1..5915b620d07dffa1b10eaeb1df28eb869e37b0aa 100644 (file)
@@ -117,10 +117,8 @@ detect_start()
   /sbin/modprobe snd-detect
 }
 
-# See how we were called.
-case "$1" in
-  start)
-       # Start driver.
+# Start driver.
+start() {
        if [ ! -d /proc/asound ]; then
                driver_start
                if [ -d /proc/asound ]; then
@@ -143,9 +141,10 @@ case "$1" in
                        msg_already_running "ALSA driver"
                fi
        fi
-       ;;
-  stop)
-       # Stop daemons.
+}
+
+# Stop daemons.
+stop() {
        if [ -d /proc/asound ]; then
                show "Shutting down sound driver"
                busy
@@ -162,11 +161,19 @@ case "$1" in
        else
                msg_not_running "ALSA driver"
        fi
+fi
+
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
        ;;
   restart|force-reload)
-       $0 stop
-       $0 start
-       exit $?
+       stop
+       start
        ;;
   status)
        # TODO
This page took 0.152311 seconds and 4 git commands to generate.