]> git.pld-linux.org Git - packages/alsa-utils.git/commitdiff
sh'ized + loglevel support
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Mon, 2 Aug 1999 10:00:39 +0000 (10:00 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    alsasound -> 1.2

alsasound

index 7a4cec05123bfdbc9d0844644067c951c71b6002..e5ee060ae588e5ac759eefdbce6eeb3bde63ccac 100644 (file)
--- a/alsasound
+++ b/alsasound
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 #
 # alsasound     This shell script takes care of starting and stopping
 #               ALSA sound driver.
@@ -22,7 +22,7 @@
 #  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 #
 #
-# For RedHat 5.0+:
+# For Polish Linux Distribution:
 # chkconfig: 2345 87 14
 # description: ALSA driver
 #
@@ -38,10 +38,14 @@ else
 MODULES_CONF=/etc/conf.modules
 fi
 
-function start() {
+driver_start()
+{
   #
   # insert all sound modules
   #
+  if OLDLOGLEV=$(cat /proc/sys/kernel/printk | awk '{print $1}' 2> /dev/null); then
+       /sbin/loglevel 1
+  fi
   cat $MODULES_CONF | grep -v "off" | \
     grep -E "^alias.+snd-card-[[:digit:]]" | \
     awk '{print $3}' | \
@@ -50,6 +54,9 @@ function start() {
       /sbin/modprobe $line; \
       ok; \
     done
+  if [ -n "$OLDLOGLEV" ]; then
+       /sbin/loglevel "$OLDLOGLEV"
+  fi
   #
   # restore driver settings
   #
@@ -60,7 +67,8 @@ function start() {
   fi
 }
 
-function detect_stop() {
+detect_stop()
+{
   #
   # remove all sound modules
   #
@@ -69,14 +77,15 @@ function detect_stop() {
   done
 }
 
-function stop() {
+driver_stop()
+{
   #
   # store driver settings
   #
   if [ -x $alsactl ]; then
     $alsactl store
   else
-    show "!!!alsactl not found!!! "; fail
+    show '!!!alsactl not found!!!'; fail
   fi
   #
   # remove all sound modules
@@ -84,7 +93,8 @@ function stop() {
   detect_stop
 }
 
-function detect_start() {
+detect_start()
+{
   #
   # run only detect module
   #
@@ -96,33 +106,34 @@ case "$1" in
   start)
         # Start driver.
        if [ ! -d /proc/asound ]; then
-         start
+         driver_start
          if [ -d /proc/asound ] && [ -d /var/lock/subsys ]; then
            touch /var/lock/subsys/alsasound
          fi
        else
          if [ -f /proc/asound/detect ]; then
-           show "Shutting down sound detect module: "
+           show "Shutting down sound detect module:"
            detect_stop
            ok
-           start
+           driver_start
            if [ -d /proc/asound ] && [ -d /var/lock/subsys ]; then
              touch /var/lock/subsys/alsasound
            fi
           else
-           show "ALSA driver is already running "; fail
+           show "ALSA driver is already running"; fail
          fi
        fi
         ;;
   stop)
         # Stop daemons.
        if [ -d /proc/asound ]; then
-          show "Shutting down sound driver: "
+          show "Shutting down sound driver:"
          if [ -f /proc/asound/detect ]; then
            detect_stop
          else
-           stop
+           driver_stop
          fi
+         (rmmod isapnp; rmmod soundcore) 2> /dev/null
          if [ -d /var/lock/subsys ]; then
            rm -f /var/lock/subsys/alsasound
          fi
@@ -139,15 +150,15 @@ case "$1" in
        # Start driver only in detect mode.
        if [ -d /proc/asound ]; then
          if [ -f /proc/asound/detect ]; then
-           show "ALSA is already running detection mode "; fail
+           show "ALSA is already running detection mode"; fail
            exit 0
           else
-           show "Shutting down sound driver: "
-           stop
+           show "Shutting down sound driver:"
+           driver_stop
            ok
          fi
        fi
-       show "Starting sound detect module: "
+       show "Starting sound detect module:"
        detect_start
        ok
        if [ -d /var/lock/subsys ]; then
This page took 0.131747 seconds and 4 git commands to generate.