67c2d54ac88b16d8b5e7a70359d3b84c2fb31470
[feisty_meow.git] / scripts / rip_burn / dvd_image.sh
1 #!/bin/bash
2
3 function show_usage()
4 {
5   echo "This script needs two parameters, (1) an ISO file to create, and"
6   echo "(2) a folder to use as the dvd/cd data for the ISO.  For example,"
7   echo "  $(basename $0) ~/grunge.iso ~/dvdimages/grungebandpro"
8   echo "where grungebandpro is presumably a directory with a dvd image."
9 }
10
11 iso_name="$1"; shift
12 folder_name="$1"; shift
13
14 if [ -z "$iso_name" -o -z "$folder_name" ]; then
15   show_usage
16   exit 3
17 fi
18
19 if [ -f "$iso_name" ]; then
20   echo -e "The ISO file must not already exist.\n"
21   show_usage
22   exit 3
23 fi
24
25 if [ ! -d "$folder_name" ]; then
26   echo -e "The provided folder name must exist.\n"
27   show_usage
28   exit 3
29 fi
30
31 mkisofs -dvd-video -o "$iso_name" "$folder_name"
32
33