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 mydir=$(cd $(dirname $0) && pwd)
22 if [ -x "$mydir/rip_dvd" ]
24 ripcmd="$mydir/rip_dvd"
26 echo >&2 "Cannot find your rip_dvd command!"
31 ##############################################################################
32 # Local Machine Settings:
33 # Sources both the "default" conf file tracked by GIT (rip_dvd.conf.dist)
34 # and the local conf file created by each local machine (rip_dvd.conf)
35 # Copy the rip_dvd.conf.dist file to rip_dvd.conf and edit the later.
36 # This will allow you to override all the default values to meet your needs
37 # in a way that won't get clobbered when you pull updates from my GIT repo.
38 ##############################################################################
39 config="${0%/*}/rip_dvd.conf"
41 # The config file will be searched for in the following location order:
44 # 1) /path/to/rip_dvd/script/rip_dvd.conf.dist
45 [ -e "${config}.dist" ] && found_config=1 && . "${config}.dist"
47 # 2) /path/to/rip_dvd/script/rip_dvd.conf
48 [ -e "${config}" ] && found_config=1 && . "${config}"
50 # 3) /etc/rip_dvd.conf
51 [ -e "/etc/rip_dvd.conf" ] && found_config=1 && . "/etc/rip_dvd.conf"
53 # 4) $PWD/rip_dvd.conf
54 [ -e "$PWD/rip_dvd.conf" ] && found_config=1 && . "$PWD/rip_dvd.conf"
56 # Check to make sure we found the config file
57 if [ $found_config -eq 0 ]; then
58 echo "-E- Unable to find the rip_dvd.conf file: $config"
62 ##############################################
63 # get the name of the DVD from the DVD disk
64 dvdname=`volname $dev | awk '{ print $1 }'`
65 dvdname=${dvdname%.} # remove trailing '.' character
67 ##############################################
68 # Find out what type of DVD we are ripping
69 # And set our destination directory appropriately
71 # - netflix = DVD ripped as an entire ISO image
72 # since these are only kept around until we watch them,
73 # there is no need to do anything less than full iso.
74 # - collection = Only DVD main feature is ripped
75 # - childrens = Only DVD main feature is ripped
76 # - church = Only DVD main feature is ripped
78 if [ "$dvdtype" == "netflix" ]; then
79 echo "-> Ripping Netflix DVD"
80 dest=/myth/video/DVDs/Netflix
82 elif [ "$dvdtype" == "collection" ]; then
83 echo "-> Ripping Personal Collection DVD"
84 dest=/myth/video/DVDs/Collection
86 elif [ "$dvdtype" == "childrens" ]; then
87 echo "-> Ripping Children's DVD"
88 dest=/myth/video/DVDs/Childrens
90 elif [ "$dvdtype" == "church" ]; then
91 echo "-> Ripping Church DVD"
92 dest=/myth/video/DVDs/Church
95 echo '-E- Must specify dvdtype as "netflix" or "collection" or "childrens" or "church"'
99 ##############################################
100 # Display progress window
102 # Pop up an xterm window and run the script inside of it
103 echo "xterm -T \"Ripping->$dvdname\" -geometry 72x15+20+10 -bg black -fg white -e \"/bin/bash\" -c \"$ripcmd -d $dest $rip_opts\" &"
104 xterm -T "Ripping->$dvdname" -geometry 72x15+20+10 -bg black -fg white -e "/bin/bash" -c "$ripcmd -d $dest $rip_opts" &
106 ##############################################
107 # OR display the script output directly in the terminal it's called from
108 #$ripcmd -d $dest $rip_opts
110 ##############################################