#!/bin/bash #Copyright Richard Heck 2006-07 # #This script is released under the General Public License # #Version 0.2 #Added options for unattended operation # #TODO: #Need to add an option for setting raw read or raw-subchan read CDRDAO=`which cdrdao 2>/dev/null`; if [ -z "$CDRDAO" ]; then echo "This script uses the cdrdao utility. It does not appear to be in your path."; exit 1; fi READ_DEVICE='/dev/sr0'; WRITE_DEVICE='/dev/sr0'; DRIVER="generic-mmc"; PROG=`basename $0`; function printUsage { cat < /tmp/$filename.toc; rm /tmp/$filename.toc2; fi WRITE="Yes"; while [ "$WRITE" = "Yes" ]; do echo "Writing to $WRITE_DEVICE at speed $SPEED"; cdrdao write -n --eject --device $WRITE_DEVICE --speed $SPEED --driver $DRIVER /tmp/$filename.toc if [ "$?" != "0" ]; then echo "Disk write failed!!"; exit 1; fi echo "Write another?" select WRITE in "Yes" "No"; do break; done done rm /tmp/$filename.bin /tmp/$filename.toc;