#!/bin/sh

OSSLIBDIR=.

if test -f `pwd`/config.dat
then
  if test -f /etc/oss.conf
  then
    OK=1
  else
	if /cat/dev/sndstat > /dev/null 2>&1
	then
		echo Error: You have another sound driver installed.
		echo Please remove it from the kernel and try again.
		exit 2
	fi
  fi
else
  echo "Error: This command must be run on the directory where OSS is installed"
  exit 1
fi

rm -f /dev/mixer0

case `uname -r` in

2.2-RELEASE)
	;;

2.2.1-RELEASE)
	;;

2.2.5-RELEASE)
	;;

2.2-GAMMA)
	;;

*)
	echo Sorry. This OSS/FreeBSD version is not compatible with your system.
	echo FreeBSD 2.2-RELEASE version is required.
	exit 1
	;;
esac

sync

if test -f $OSSLIBDIR/license.ins
then
	$OSSLIBDIR/checklic $OSSLIBDIR/license.ins $OSSLIBDIR/license.asc
fi

mknod /dev/mixer0 c 30 0
echo OSSLIBDIR=`pwd` > /etc/oss.conf

sh ./install2.sh

echo OSS/FreeBSD files have been installed. Use "soundconf" to configure.
