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