X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=aumix.init;h=017dc0f7eed96a6a3b004c2362df4ad8117b7759;hb=ef03a246c95cd62956429b9076d469496468e40c;hp=97b8c1d67a6b0e040a253dd6a8336405976b2bde;hpb=2c9e731effef1b750adf796746269c9e61e2ad48;p=packages%2Faumix.git diff --git a/aumix.init b/aumix.init index 97b8c1d..017dc0f 100644 --- a/aumix.init +++ b/aumix.init @@ -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." 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