]> git.pld-linux.org Git - packages/aumix.git/blobdiff - aumix.init
- fixed categories
[packages/aumix.git] / aumix.init
index 3db69a7770cb23b84b4de01e867c960d47445c0c..963a8c8ab6a780f4c0aa0922eb51de0e5d5f98e6 100644 (file)
@@ -2,17 +2,17 @@
 #
 # aumix                Sound mixer setup.
 #
-# chkconfig:    345  85 15
+# chkconfig:   345 85 15
 #
-# description: Saves sound mixer's settings on system shutdown and restores
+# description: Saves sound mixer's settings on system shutdown and restores \
 #              them on system startup.
 
 # Source function library
 . /etc/rc.d/init.d/functions
 
-[ -f /etc/sysconfig/aumix ] && /etc/sysconfig/aumix
+[ -f /etc/sysconfig/aumix ] && /etc/sysconfig/aumix
 
-RETVAL=$?
+RETVAL=0
 # See how we were called.
 case "$1" in
   start)
@@ -21,18 +21,14 @@ case "$1" in
                show "Setting up sound card mixer"
                busy
                if [ "$AUMIX_AUTO_INIT" = "yes" ]; then
-                       daemon aumix -f /etc/aumixrc -L >/dev/null
+                       aumix -f /etc/aumixrc -L >/dev/null
                        RETVAL=$?
-                       [ $RETVAL -eq 0 ] && ok || fail
-                       [ $RETVAL -eq 0 ] && touch /var/lock/subsys/aumix
-               else
-                       touch /var/lock/subsys/aumix
-                       ok
                fi
+               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/aumix && ok || fail
        else
                nls "Sound card mixer is already set up"
        fi
-        ;;
+       ;;
   stop)
        if [ -f /var/lock/subsys/aumix ]; then
                show "Saving sound card mixer's settings"
@@ -45,18 +41,15 @@ case "$1" in
        else
                nls "Sound card mixer hasn't been set up"
        fi      
-        ;;
+       ;;
   restart|force-reload)
-        $0 stop
+       $0 stop
        $0 start
        exit $0
-        ;;
+       ;;
   save)
-       show "Saving sound card mixer's settings"
-       busy
-       aumix -f /etc/aumixrc -S
-       ok
-       ;;
+       run_cmd "Saving sound card mixer's settings" aumix -f /etc/aumixrc -S
+       ;;
   restore|reload)
        show "Setting up sound card mixer"
        busy
@@ -81,15 +74,15 @@ case "$1" in
                        if [ $? = 0 ]; then
                                nls "MIDI device not detected."
                        fi
-               fi    
+               fi
 
        else
                nls "Sound card not configured."
-        fi
-        ;;
+       fi
+       ;;
   *)
        msg_usage "$0 {start|stop|restart|reload|force-reload|save|restore|status}"
-        exit 3
+       exit 3
 esac
 
 exit $RETVAL
This page took 0.042906 seconds and 4 git commands to generate.