home *** CD-ROM | disk | FTP | other *** search
Wrap
#!/bin/sh #simple script to burn an iso file to cd, using cdrecord. #while [ ! -f /etc/cdburnerdevice ];do # xmessage -bg "#ff8080" -center -name "burniso2cd" -title "Burniso2cd: No CD burner" -buttons "CD_Wizard:10,EXIT:11" "A problem... #You have not yet run the Puppy CD/DVD drive Wizard, to choose #which CD/DVD drive will be the burner drive. #I know that it seems somewhat academic if your PC only has one #CD/DVD drive, but you have to do it. #Click \"CD_Wizard\" button now to run the Wizard, then click on #\"Choose burner\" then click on \"EXIT\", which will bring you back #to this script. # #Click \"CD_Wizard\" button to run CD/DVD Wizard..." # case $? in # 10) # /usr/sbin/cdburner-wizard # ;; # *) # exit # ;; # esac #done #if [ "`cat /etc/scsiemul 2> /dev/null`" = "on" ];then # xmessage -bg "#ff8080" -center -name "burniso2cd" -title "Burniso2cd: ERROR" -buttons "EXIT:11" "This script is setup to do ATAPI CD burning, but you have #SCSI-emulation turned on. Therefore this script cannot burn #the iso file to CD and you will have to do it in a CD-burner #program such as Gcombust or Xcdroast. #So, no choice now but to exit script." # exit #fi #v2.0.0 MEDIATYPE="`Xdialog --title "Burniso2cd" --stdout --menubox "Welcome to our little CD/DVD burner program!\nPlease choose whether you want to burn to a CD or DVD media.\nNote that DVDs are always burnt 'open' so can be used by Puppy\nas normal or multisession, whereas for CD you will be given\nthe choice further on whether to burn as closed or open." 0 0 5 CD "CD-R or CD-RW (must be blank)" DVD "DVD-R or DVD-RW (must be blank)"`" [ ! $? -eq 0 ] && exit #v2.0.0 if [ "$MEDIATYPE" = "CD" ];then SCSIDRIVES="`cdrecord -scanbus 2>&1 | grep '[0-9],[0-9],[0-9]' | grep -v '*$' | tr '|' " " | tr '\t' '|' | cut -f 2,3 -d '|' | tr -s " " | tr "'" '_' | tr " " '_' | tr -s '_'`" #' ATAPIDRIVES="`probedisk | grep '|cdrom|' | grep '/dev/hd' | cut -f 1,3 -d '|' | tr " " '_' | tr -s '_'`" else ATAPIDRIVES="`probedisk | grep '|cdrom|' | grep '/dev/hd' | cut -f 1,3 -d '|' | tr " " '_' | tr -s '_'`" SCSIDRIVES="`probedisk | grep '/dev/scd' | cut -f 1,3 -d '|' | tr " " '_' | tr -s '_'`" fi SELECTIONS="$ATAPIDRIVES $SCSIDRIVES" SELECTIONX="`echo "$SELECTIONS" | tr '|' " " | tr "\n" " "`" BURNERDRIVE="`Xdialog --title "Burniso2cd: Choose burner drive" --stdout --menubox "Choose the CD/DVD drive to burn to\n(/dev/scd0 or 0,0,0 format are SCSI drives,\n/dev/hda format are IDE/ATAPI drives)" 0 0 5 $SELECTIONX 2> /dev/null`" [ ! $? -eq 0 ] && exit if [ ! "`echo -n "$BURNERDRIVE" | grep '/dev/'`" = "" ];then #better not write 0,0,0 format... [ ! -f /etc/cdburnerdevice ] && echo -n "$BURNERDRIVE" | sed -e 's/\/dev\///g' > /etc/cdburnerdevice fi ISOFILE="`Xdialog --backtitle "Please choose the iso file..." --title "Burniso2cd: Choose iso file" --stdout --no-buttons --fselect "*.iso" 0 0`" if [ ! $? -eq 0 ];then exit fi #BURNERDRIVE="/dev/`cat /etc/cdburnerdevice`" #set by CD/DVD Wizard. CDR="$BURNERDRIVE" #CDDESCR="`probedisk | grep "$CDR" | cut -f 3 -d '|'`" CDDESCR="`echo "$SELECTIONS" | grep "$CDR" | cut -f 2 -d '|'`" while [ ! "`mount | grep "$CDR"`" = "" ];do xmessage -bg "#ff8080" -center -name "burniso2cd" -title "Burniso2cd: ERROR" "The $CDR CD/DVD drive, described as: $CDDESCR is currently mounted. Use MUT to unmount it. Please unmount CD drive, then click OK button..." done if [ "$MEDIATYPE" = "CD" ];then xmessage -bg "#ffc0c0" -center -name "burniso2cd" -title "Burniso2cd" -buttons "NORMAL-CD:10,MULTI-CD:11" "You have selected iso file: $ISOFILE Do you want to burn a multi-session CD? A multi-session CD is one that is left \"open\" so that further tracks may be burnt later. The iso file that you have selected will be burnt now as the first track. Note, this is an experimental option for the Puppy live-CD, to allow burning of sessions back to CD, thus personal data is saved to CD and a hard drive or usb stick is not required. If you choose MULTI-CD, you will be burning to a CD-R or CD-RW. Please choose NORMAL unless you have some special reason to burn the CD multi-session (such as the iso is specifically for multisession). Click MULTI-CD button for multi-session... Click NORMAL-CD button for normal burn..." RETVAL=$? else RETVAL=12 fi case $RETVAL in 10) #normal cd BURNMULTI="-dao" #v2.02 added -dao BURNMSG="" ;; 13) #normal dvd BURNMULTI="" BURNMSG="(blank DVD-R. A DVD-RW will be fast-wiped if it already has data)" ;; 11) #multi cd BURNMULTI="-multi -tao -pad" #v2.02 added -tao -pad BURNMSG="" ;; 12) #multi dvd BURNMULTI="yes" BURNMSG="(blank DVD-R. A DVD+/-RW will be fast-wiped if it has data)" ;; *) exit ;; esac while [ 1 ];do #burn-again-loop xmessage -bg "#ffc0c0" -center -name "burniso2cd" -title "Burniso2cd: Burn $MEDIATYPE" -buttons "OKAY:10" "Please insert blank $MEDIATYPE into $CDR $BURNMSG (which is described as: ${CDDESCR}) Then click OKAY button..." if [ ! $? -eq 10 ];then exit fi if [ "$MEDIATYPE" = "CD" ];then #echo "Now executing:" #echo " cdrecord $BURNMULTI -data -eject -v speed=4 dev=ATAPI:$CDR $ISOFILE" sync if [ ! "`echo "$CDR" | grep '/dev/hd'`" = "" ];then DEVDEV="ATAPI:$CDR" else DEVDEV="$CDR" fi echo "Now executing:" echo " cdrecord $BURNMULTI -data -eject -v speed=4 dev=$DEVDEV $ISOFILE" rxvt -name burniso2cd -bg orange -geometry 80x10 -e cdrecord $BURNMULTI -data -eject -v speed=4 dev=$DEVDEV "$ISOFILE" else #dvd echo "Now executing:" echo " growisofs -speed=4 -Z $CDR=$ISOFILE" rxvt -name burniso2cd -bg orange -geometry 80x10 -e growisofs -speed=4 -Z $CDR="$ISOFILE" fi sync echo "...done" eject $CDR xmessage -bg "#80ff80" -center -name "burniso2cd" -title "Burniso2cd: Finished" -buttons "FINISHED:10,REPEAT:11" "If all went well, you have now burnt iso file $ISOFILE to a $MEDIATYPE! If you want to burn the iso file to another $MEDIATYPE, click REPEAT button... Otherwise, click FINISHED to quit..." [ $? -lt 11 ] && break done #burn-again-loop ###END###