--- /dev/null
+#!/usr/bin/env bash
+
+die() {
+ echo $@
+ exit 1
+}
+
+my_uname=$(uname -a)
+case "${my_uname}" in
+ Darwin*) ;;
+ *)die "This script only works on MacOS"
+esac
+
+usage() {
+ cat <<EOF
+nero.sh: CD-R burning tool for MacOS.
+
+-d [directory] Create a data CD using the given directory
+-k Skip cleanup
+-h Show this help message
+EOF
+}
+
+data_dir=""
+skip_cleanup=0
+while getopts "d:kh" flag; do
+ case $flag in
+ d) data_dir="${OPTARG}";;
+ k) skip_cleanup=1;;
+ h) usage; exit 0;;
+ *) usage; exit 1;;
+ esac
+done
+shift $OPTIND
+[[ $# -ne 0 ]] || die "unknown arguments at end. -h for help."
+
+if [[ $data_dir != "" ]]; then
+ temp_dir="`mktemp -d`"
+ echo "== created temporary directory $temp_dir"
+ if [[ $skip_cleanup == 1 ]]; then
+ echo "== will not install cleanup hook"
+ else
+ function remove_iso_temp {
+ echo "== removing $temp_dir"
+ rm -rf -- "${temp_dir}"
+ }
+ trap remove_iso_temp EXIT
+ fi
+ echo "== creating ${temp_dir}/iso"
+ hdiutil makehybrid -iso -joliet -o "${temp_dir}/temp" "${data_dir}"
+ echo "== burning ${temp_dir}/temp.iso"
+ hdiutil burn "${temp_dir}/temp.iso"
+else
+ die "You must supply a path. -h for help."
+fi