#!/bin/sh
cat << EOF

cdtool needs to know what the device name is for your audio CD-ROM.  You
can either make a link from /dev/cdrom to your device, or you can set the
environment variable CDTOOLDEV to the actuall device.

This script will change the /dev/cdrom link.

EOF

if [ -e /dev/cdrom ]
then
	echo "Here is /dev/cdrom:"
	ls -l /dev/cdrom
	echo ""
	echo -e "What would you like to change the link to? \c"
	read NEWDEV
	if [ "x$NEWDEV" = "x" ]
	then
		echo "Leaving old link intact"
	else
		rm -rf /dev/cdrom
		ln -s $NEWDEV /dev/cdrom
	fi
else
	echo -e "What device is your CD-ROM that you want to play audio CDs from? \c"
	read NEWDEV
	if [ "x$NEWDEV" = "x" ]
	then
		echo "Not making a link"
	else
		rm -rf /dev/cdrom
		ln -s $NEWDEV /dev/cdrom
	fi
fi

echo "You can change the link at any time by running /usr/sbin/changeaudiocddev"
