#
# Sound driver installation script
#
TMP=/tmp/sound.err
ERR1=" Errors have been written to the file $TMP."
ERR2=" The Sound Driver software was not installed."

echo "Installing Sound Driver Package"

/etc/conf/bin/idcheck -p snd 2>$TMP
if [ $? != 0 ]
then
	echo "The sound package is already at least partly installed.
	Removing the old version now..."
	/etc/conf/bin/idinstall -d snd
fi

/etc/conf/bin/idinstall -a -k snd 2>>$TMP
if [ $? != 0 ]
then
	message "There was an error during package installation. $ERR1 $ERR2"
	exit 1
fi

/etc/conf/bin/idbuild 2>>$TMP
if [ $? != 0 ]
then
	message "There was an error during kernel reconfiguration. $ERR1 $ERR2"
	exit 1
fi

rm -f $TMP

#echo "Performing shutdown..."
#cd /; exec /etc/shutdown -g0 -y
echo "Sound Driver installed. Remember to reboot"
