"Fossies" - the Fresh Open Source Software Archive

Member "usr/lib/oss/etc/S89oss" (14 Feb 2014, 1498 Bytes) of archive /linux/misc/oss-linux-v4.2-2011-i386.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/bash
    2 #
    3 #       /etc/rc.d/init.d/oss
    4 #
    5 # Starts the OSS sound driver
    6 #
    7 # chkconfig: 2345 80 20
    8 # description: Open Sound System for Linux (OSS/Linux) is a \
    9 # commercial quality sound driver distributed by 4Front Technologies \
   10 # (http://www.opensound.com).
   11 
   12 ### BEGIN INIT INFO
   13 # Provides: oss
   14 # Required-Start: $local_fs $remote_fs 
   15 # Should-Start: 
   16 # Required-Stop:
   17 # Default-Start: 2 3 4 5
   18 # Default-Stop: 0 1 6
   19 # Short-Description: Start OSS
   20 ### END INIT INFO
   21 
   22 # Source function library.
   23 if test -f /lib/lsb/init-functions
   24 then
   25 . /lib/lsb/init-functions
   26 fi
   27 
   28 if test -f /etc/rc.d/init.d/functions
   29 then
   30 . /etc/rc.d/init.d/functions
   31 fi
   32 
   33 # Add oss configuration.
   34 . /etc/oss.conf
   35 
   36 RETVAL=0
   37 
   38 #
   39 #       See how we were called.
   40 #
   41 case "$1" in
   42   start)
   43         # Check if OSS is already running
   44         echo -n 'Starting Open Sound System: '
   45         if ! test -f /usr/sbin/soundon
   46     then
   47         exit 0
   48     fi
   49 
   50     if test -f $OSSLIBDIR/starting
   51     then
   52         ls -l $OSSLIBDIR/starting
   53         echo Previous start of OSS crashed the system
   54         echo Please resolve the situation and remove file
   55         echo \"$OSSLIBDIR/starting\". Then start OSS by
   56         echo running soundon
   57         exit 0
   58     fi
   59 
   60     if ! /usr/sbin/soundon
   61     then
   62       echo Starting OSS failed
   63     fi
   64     rm -f $OSSLIBDIR/starting
   65         ;;
   66   stop)
   67         echo -n 'Stopping Open Sound System: '
   68 
   69     /usr/sbin/savemixer
   70     exit 0
   71         ;;
   72   restart)
   73         $0 stop
   74     /usr/sbin/soundoff
   75         $0 start
   76         ;;
   77   *)
   78         echo "Usage: $0 {start|stop|restart}"
   79         exit 1
   80 esac