scripts

misc scripts and tools
git clone git://git.2f30.org/scripts.git
Log | Files | Refs

burndisc (629B)


      1 #!/bin/sh
      2 
      3 # fairly portable on the fly data burning script
      4 # depends: mkisofs cdrecord
      5 
      6 # try common names for cdrom devs
      7 for D in $CDROM /dev/cdrom /dev/cd0c /dev/sr0; do
      8     if test -b $D; then DEV=$D && break; fi
      9 done
     10 if test -z "$DEV"; then
     11     echo create a /dev/cdrom symlink or set the CDROM env var
     12     exit 1
     13 fi
     14 echo using device $DEV
     15 
     16 # use dir name as volume id
     17 VOLID=$(basename $PWD)
     18 echo -n $(du -shL .) $VOLID"? " && read
     19 
     20 # burn on the fly
     21 SIZ=$(mkisofs -J -R -f -q -print-size .)
     22 mkisofs -J -R -f -V $VOLID . \
     23 | cdrecord -dev=$DEV -speed=1 -driveropts=burnfree \
     24            -dao -tsize=${SIZ}s -pad -eject -v -