3 ##############################################
4 # COMMAND LINE PROCESSING
6 # get the dvdtype from the command line
9 # remove the dvdtype from the args, and interpret the rest
10 # of the args to be passed directly to the rip_dvd script.
13 ##############################################
14 if [ -z "$dvdtype" ]; then
15 echo "-E- $0 <dvdtype>' is a required option"
19 ##############################################################################
20 # Local Machine Settings:
21 # Sources both the "default" conf file tracked by GIT (rip_dvd.conf.dist)
22 # and the local conf file created by each local machine (rip_dvd.conf)
23 # Copy the rip_dvd.conf.dist file to rip_dvd.conf and edit the later.
24 # This will allow you to override all the default values to meet your needs
25 # in a way that won't get clobbered when you pull updates from my GIT repo.
26 ##############################################################################
27 config="${0%/*}/rip_dvd.conf"
29 # The config file will be searched for in the following location order:
32 # 1) /path/to/rip_dvd/script/rip_dvd.conf.dist
33 [ -e "${config}.dist" ] && found_config=1 && . "${config}.dist"
35 # 2) /path/to/rip_dvd/script/rip_dvd.conf
36 [ -e "${config}" ] && found_config=1 && . "${config}"
38 # 3) /etc/rip_dvd.conf
39 [ -e "/etc/rip_dvd.conf" ] && found_config=1 && . "/etc/rip_dvd.conf"
41 # 4) $PWD/rip_dvd.conf
42 [ -e "$PWD/rip_dvd.conf" ] && found_config=1 && . "$PWD/rip_dvd.conf"
44 # Check to make sure we found the config file
45 if [ $found_config -eq 0 ]; then
46 echo "-E- Unable to find the rip_dvd.conf file: $config"
50 ##############################################
51 # get the name of the DVD from the DVD disk
52 dvdname=`volname $dev | awk '{ print $1 }'`
53 dvdname=${dvdname%.} # remove trailing '.' character
55 ##############################################
56 # Find out what type of DVD we are ripping
57 # And set our destination directory appropriately
59 # - netflix = DVD ripped as an entire ISO image
60 # since these are only kept around until we watch them,
61 # there is no need to do anything less than full iso.
62 # - collection = Only DVD main feature is ripped
63 # - childrens = Only DVD main feature is ripped
64 # - church = Only DVD main feature is ripped
66 if [ "$dvdtype" == "netflix" ]; then
67 echo "-> Ripping Netflix DVD"
68 dest=/myth/video/DVDs/Netflix
70 elif [ "$dvdtype" == "collection" ]; then
71 echo "-> Ripping Personal Collection DVD"
72 dest=/myth/video/DVDs/Collection
74 elif [ "$dvdtype" == "childrens" ]; then
75 echo "-> Ripping Children's DVD"
76 dest=/myth/video/DVDs/Childrens
78 elif [ "$dvdtype" == "church" ]; then
79 echo "-> Ripping Church DVD"
80 dest=/myth/video/DVDs/Church
83 echo '-E- Must specify dvdtype as "netflix" or "collection" or "childrens" or "church"'
87 ##############################################
88 # Display progress window
90 # Pop up an xterm window and run the script inside of it
91 echo "xterm -T \"Ripping->$dvdname\" -geometry 72x15+20+10 -bg black -fg white -e \"/bin/bash\" -c \"$ripcmd -d $dest $rip_opts\" &"
92 xterm -T "Ripping->$dvdname" -geometry 72x15+20+10 -bg black -fg white -e "/bin/bash" -c "$ripcmd -d $dest $rip_opts" &
94 ##############################################
95 # OR display the script output directly in the terminal it's called from
96 #$ripcmd -d $dest $rip_opts
98 ##############################################