2 # The purpose of this script is to encapsulate the calls
3 # made to the rip_dvd script. This is done to help distribute
4 # the resulting ripped files to the proper folders. This
5 # script is called from the mythtv menus for example with a
6 # smaller set of options.
8 ##############################################
9 # COMMAND LINE PROCESSING
11 # get the dvdtype from the command line
14 # remove the dvdtype from the args, and interpret the rest
15 # of the args to be passed directly to the rip_dvd script.
18 ##############################################
19 if [ -z "$dvdtype" ]; then
20 echo "-E- $0 <dvdtype>' is a required option"
24 ##############################################################################
25 # Local Machine Settings:
26 # Sources both the "default" conf file tracked by GIT (rip_dvd.conf.dist)
27 # and the local conf file created by each local machine (rip_dvd.conf)
28 # Copy the rip_dvd.conf.dist file to rip_dvd.conf and edit the later.
29 # This will allow you to override all the default values to meet your needs
30 # in a way that won't get clobbered when you pull updates from my GIT repo.
31 ##############################################################################
32 config="${0%/*}/rip_dvd.conf"
34 # The config file will be searched for in the following location order:
37 # 1) /path/to/rip_dvd/script/rip_dvd.conf.dist
38 [ -e "${config}.dist" ] && found_config=1 && . "${config}.dist"
40 # 2) /path/to/rip_dvd/script/rip_dvd.conf
41 [ -e "${config}" ] && found_config=1 && . "${config}"
43 # 3) /etc/rip_dvd.conf
44 [ -e "/etc/rip_dvd.conf" ] && found_config=1 && . "/etc/rip_dvd.conf"
46 # 4) $PWD/rip_dvd.conf
47 [ -e "$PWD/rip_dvd.conf" ] && found_config=1 && . "$PWD/rip_dvd.conf"
49 # Check to make sure we found the config file
50 if [ $found_config -eq 0 ]; then
51 echo "-E- Unable to find the rip_dvd.conf file: $config"
55 ##############################################
56 # get the name of the DVD from the DVD disk
57 dvdname=`volname $dev | awk '{ print $1 }'`
58 dvdname=${dvdname%.} # remove trailing '.' character
60 ##############################################
61 # Find out what type of DVD we are ripping
62 # And set our destination directory appropriately
64 # - netflix = DVD ripped as an entire ISO image
65 # since these are only kept around until we watch them,
66 # there is no need to do anything less than full iso.
67 # - collection = Only DVD main feature is ripped
68 # - childrens = Only DVD main feature is ripped
69 # - church = Only DVD main feature is ripped
71 if [ "$dvdtype" == "netflix" ]; then
72 echo "-> Ripping Netflix DVD"
73 dest=/myth/video/DVDs/Netflix
75 elif [ "$dvdtype" == "collection" ]; then
76 echo "-> Ripping Personal Collection DVD"
77 dest=/myth/video/DVDs/Collection
79 elif [ "$dvdtype" == "childrens" ]; then
80 echo "-> Ripping Children's DVD"
81 dest=/myth/video/DVDs/Childrens
83 elif [ "$dvdtype" == "church" ]; then
84 echo "-> Ripping Church DVD"
85 dest=/myth/video/DVDs/Church
88 echo '-E- Must specify dvdtype as "netflix" or "collection" or "childrens" or "church"'
92 ##############################################
93 # Display progress window
95 # Pop up an xterm window and run the script inside of it
96 echo "xterm -T \"Ripping->$dvdname\" -geometry 72x15+20+10 -bg black -fg white -e \"/bin/bash\" -c \"$ripcmd -d $dest $rip_opts\" &"
97 xterm -T "Ripping->$dvdname" -geometry 72x15+20+10 -bg black -fg white -e "/bin/bash" -c "$ripcmd -d $dest $rip_opts" &
99 ##############################################
100 # OR display the script output directly in the terminal it's called from
101 #$ripcmd -d $dest $rip_opts
103 ##############################################