11 *)die "This script only works on MacOS"
16 nero.sh: CD-R burning tool for MacOS.
18 -d [directory] Create a data CD using the given directory
20 -h Show this help message
26 while getopts "d:kh" flag; do
28 d) data_dir="${OPTARG}";;
35 [[ $# -ne 0 ]] || die "unknown arguments at end. -h for help."
37 if [[ $data_dir != "" ]]; then
38 temp_dir="`mktemp -d`"
39 echo "== created temporary directory $temp_dir"
40 if [[ $skip_cleanup == 1 ]]; then
41 echo "== will not install cleanup hook"
43 function remove_iso_temp {
44 echo "== removing $temp_dir"
45 rm -rf -- "${temp_dir}"
47 trap remove_iso_temp EXIT
49 echo "== creating ${temp_dir}/iso"
50 hdiutil makehybrid -iso -joliet -o "${temp_dir}/temp" "${data_dir}"
51 echo "== burning ${temp_dir}/temp.iso"
52 hdiutil burn "${temp_dir}/temp.iso"
54 die "You must supply a path. -h for help."