#! /bin/bash

# Script to perform the common-case data DVD burning. Argument should be a
# directory at a minimum. Any other growisofs or mkisofs args are
# good here.

device=/dev/sr0

# speed of 4 is safe with Toshiba and JVC 8x media
prefix="growisofs -Z $device -r -J -speed=4"

case "$1" in
   "" | "-h" | "--help")
      echo "command: $prefix [ADDL ARGS] DIR"
      echo
      echo "useful args:"
      echo "  -dry-run"
      echo "  -joliet-long instead of -J"
      echo "  -speed=[SPEED] or none (default, max) instead of 4 as above"
      echo "  exclusions: -x EXCL1 -x EXCL2 ... DIR"
      echo "    can be tricky, mind slashes and where . is, example:"
      echo "      \$ cd TOPLEVELDIR"
      echo "      \$ burn-dvd -x ./DIR -x ./FILE ."
      echo "  when trying to burn individual files larger than 2G: -iso-level 3"
      echo "    (see man mkisofs(8))"
      exit 1
      ;;
esac

$prefix $*
