]> git.pld-linux.org Git - packages/aumix.git/blobdiff - aumix.init
- RETVAL initial setting
[packages/aumix.git] / aumix.init
index 590d21387896948098ab2f700bae9cdc1678dc1b..f338ad2d8f849d47e39be36d2aa55ad2adfbc3c7 100644 (file)
@@ -10,6 +10,9 @@
 # Source function library
 . /etc/rc.d/init.d/functions
 
+[ -f /etc/sysconfig/aumix ] && . /etc/sysconfig/aumix
+
+RETVAL=0
 # See how we were called.
 case "$1" in
   start)
@@ -17,38 +20,37 @@ case "$1" in
        if [ ! -f /var/lock/subsys/aumix ]; then
                show "Setting up sound card mixer"
                busy
-               aumix -f /etc/aumixrc -L >/dev/null
-               RETVAL=$?
-               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/aumix
-               ok
+               if [ "$AUMIX_AUTO_INIT" = "yes" ]; then
+                       aumix -f /etc/aumixrc -L >/dev/null
+                       RETVAL=$?
+               fi
+               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/aumix && ok || fail
        else
                nls "Sound card mixer is already set up"
-               exit 1
        fi
         ;;
   stop)
        if [ -f /var/lock/subsys/aumix ]; then
                show "Saving sound card mixer's settings"
                busy
-               aumix -f /etc/aumixrc -S
+               if [ "$AUMIX_AUTO_SAVE" = "yes" ]; then
+                       aumix -f /etc/aumixrc -S
+               fi
                rm -f /var/lock/subsys/aumix >/dev/null 2>&1
                ok
        else
                nls "Sound card mixer hasn't been set up"
-               exit 1
        fi      
         ;;
-  restart)
+  restart|force-reload)
         $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)
+  restore|reload)
        show "Setting up sound card mixer"
        busy
        aumix -f /etc/aumixrc -L >/dev/null
@@ -59,28 +61,28 @@ case "$1" in
        if [ $? = 0 ]; then
                lsmod | grep -q "\(sound\|audio\)"
                if [ $? = 0 ]; then
-                       echo "Modular sound card detected."
+                       nls "Modular sound card detected."
                else
-                       echo "Monolithic sound card detected."
+                       nls "Monolithic sound card detected."
                fi
  
                cat /dev/sndstat 2> /dev/null | grep -A 1 "Midi devices:" | grep -q [0-9]:
                if [ $? = 0 ]; then
-                       echo "MIDI device present."
+                       nls "MIDI device present."
                else
                        cat /dev/sndstat >/dev/null 2>&1
                        if [ $? = 0 ]; then
-                               echo "MIDI device not detected."
+                               nls "MIDI device not detected."
                        fi
                fi    
 
        else
-               echo "Sound card not configured."
+               nls "Sound card not configured."
         fi
         ;;
   *)
-       msg_Usage "$0 {start|stop|status|restart|save|restore}"
-        exit 1
+       msg_usage "$0 {start|stop|restart|reload|force-reload|save|restore|status}"
+        exit 3
 esac
 
 exit $RETVAL
This page took 0.040039 seconds and 4 git commands to generate.