refactoring the directories, especially for scripts; moved gimp stuff out to db since...
[feisty_meow.git] / scripts / rip_burn / blu_burn.sh
diff --git a/scripts/rip_burn/blu_burn.sh b/scripts/rip_burn/blu_burn.sh
new file mode 100644 (file)
index 0000000..26f071b
--- /dev/null
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+function show_usage()
+{
+  echo "This script needs two parameters, (1) an ISO file that provides the"
+  echo "data for the blu-ray and (2) the device to use for burning, e.g."
+  echo "  $(basename $0) ~/grunge.iso /dev/sr1"
+}
+
+iso_name="$1"; shift
+device_name="$1"; shift
+
+if [ -z "$iso_name" -o -z "$device_name" ]; then
+  show_usage
+  exit 3
+fi
+
+if [ ! -f "$iso_name" ]; then
+  echo -e "The ISO file must already exist.\n"
+  show_usage
+  exit 3
+fi
+
+if [ ! -b "$device_name" ]; then
+  echo -e "The device name provided must exist and be block-special type.\n"
+  show_usage
+  exit 3
+fi
+
+"$iso_name" "$device_name"
+
+growisofs -speed=2 -dvd-compat -Z ${device_name}=${iso_name}
+