33317c0e84fa9ca584f73b0b24d60341a6b2ea2e
[feisty_meow.git] / scripts / rip_burn / blu_burn.sh
1 #!/bin/bash
2
3 # burns a bluray disc image onto a physical medium.
4
5 function show_usage()
6 {
7   echo "This script needs two parameters, (1) an ISO file that provides the"
8   echo "data for the blu-ray and (2) the device to use for burning, e.g."
9   echo "  $(basename $0) ~/grunge.iso /dev/sr1"
10 }
11
12 iso_name="$1"; shift
13 device_name="$1"; shift
14
15 if [ -z "$iso_name" -o -z "$device_name" ]; then
16   show_usage
17   exit 3
18 fi
19
20 if [ ! -f "$iso_name" ]; then
21   echo -e "The ISO file must already exist.\n"
22   show_usage
23   exit 3
24 fi
25
26 if [ ! -b "$device_name" ]; then
27   echo -e "The device name provided must exist and be block-special type.\n"
28   show_usage
29   exit 3
30 fi
31
32 echo iso "$iso_name" dev "$device_name"
33
34 growisofs -dvd-compat -Z ${device_name}=${iso_name}
35 #used to be appended to above line: -speed=2 
36 #trying with letting it go default speed.  has been working for us recently.
37