]> git.pld-linux.org Git - packages/aumix.git/blobdiff - aumix.init
- replaced xpm icon with a (based on it) png one
[packages/aumix.git] / aumix.init
index 97b8c1d67a6b0e040a253dd6a8336405976b2bde..017dc0f7eed96a6a3b004c2362df4ad8117b7759 100644 (file)
@@ -10,6 +10,8 @@
 # Source function library
 . /etc/rc.d/init.d/functions
 
+. /etc/sysconfig/aumix
+
 # See how we were called.
 case "$1" in
   start)
@@ -17,22 +19,26 @@ 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
+               if [ "$AUMIX_AUTO_INIT" = "yes" ]; then
+                       aumix -f /etc/aumixrc -L >/dev/null
+                       RETVAL=$?
+                       [ $RETVAL -eq 0 ] && touch /var/lock/subsys/aumix
+               else
+                       touch /var/lock/subsys/aumix
+               fi
                ok
        else
-               # show "%s service is already running." <service>
                nls "Sound card mixer is already set up"
                exit 1
        fi
         ;;
   stop)
-        # Stop daemons.
        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
@@ -57,11 +63,31 @@ case "$1" in
        ok
        ;;
   status)
-       status aumix
-       exit $?
+       cat /proc/devices | grep -q "\(sparcaudio\|sound\)"
+       if [ $? = 0 ]; then
+               lsmod | grep -q "\(sound\|audio\)"
+               if [ $? = 0 ]; then
+                       echo "Modular sound card detected."
+               else
+                       echo "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."
+               else
+                       cat /dev/sndstat >/dev/null 2>&1
+                       if [ $? = 0 ]; then
+                               echo "MIDI device not detected."
+                       fi
+               fi    
+
+       else
+               echo "Sound card not configured."
+        fi
         ;;
   *)
-       msg_Usage "$0 {start|stop|status|restart|save|restore}"
+       msg_usage "$0 {start|stop|status|restart|save|restore}"
         exit 1
 esac
 
This page took 0.038454 seconds and 4 git commands to generate.