#!/bin/sh
#
# pinnacle -- Start and stop a Turtle Beach Pinnacle or Fiji sound card

# Source function library.
. /etc/rc.d/init.d/functions

# Source configuration options
. /etc/sysconfig/pinnacle

# See how we were called.
case "$1" in
  start)
	echo "Initializing msnd_pinnacle kernel module..."
	insmod soundcore
	insmod msnd
	insmod msnd_pinnacle $PINNACLE_OPTIONS
	exit 0
	;;
  stop)
	rmmod msnd_pinnacle
	rmmod msnd
	rmmod soundcore
	exit 0
	;;
  status)
	# this is way overkill, but at least we have some status output...
	if [ grep msnd < /proc/modules ]; then
		echo "The pinnacle driver is loaded"
	else
		echo "The pinnacle driver is not loaded"
	fi
	;;
  restart|reload)
	$0 stop
	$0 start
	;;
  *)
	# do not advertise unreasonable commands that there is no reason
	# to use with this device
	echo "Usage: pinnacle {start|stop|status|restart|reload}"
	exit 1
esac

exit 0

