Updated usage for new -a option
[rip_dvd/.git] / rip_dvd.wrap
1 #!/bin/bash
2
3 ##############################################
4 # COMMAND LINE PROCESSING
5
6 # get the dvdtype from the command line
7 dvdtype=$1
8
9 # remove the dvdtype from the args, and interpret the rest
10 # of the args to be passed directly to the rip_dvd script.
11 shift 1
12
13 ##############################################
14 if [ -z "$dvdtype" ]; then
15   echo "-E- $0 <dvdtype>' is a required option"
16   usage
17 fi
18
19 ##############################################
20 # get the name of the DVD from the DVD disk
21 dvdname=`volname $dev | awk '{ print $1 }'`
22 dvdname=${dvdname%.} # remove trailing '.' character
23
24 ##############################################
25 # Find out what type of DVD we are ripping
26 # And set our destination directory appropriately
27 # dvdtype parameter:
28 # - netflix = DVD ripped as an entire ISO image
29 #   since these are only kept around until we watch them,
30 #   there is no need to do anything less than full iso.
31 # - collection = Only DVD main feature is ripped
32 # - childrens = Only DVD main feature is ripped
33 # - church = Only DVD main feature is ripped
34 rip_opts="$*"
35 if [ "$dvdtype" == "netflix" ]; then
36   echo "-> Ripping Netflix DVD"
37   dest=/myth/video/DVDs/Netflix
38   rip_opts="$rip_opts"
39 elif [ "$dvdtype" == "collection" ]; then
40   echo "-> Ripping Personal Collection DVD"
41   dest=/myth/video/DVDs/Collection
42   rip_opts="$rip_opts"
43 elif [ "$dvdtype" == "childrens" ]; then
44   echo "-> Ripping Children's DVD"
45   dest=/myth/video/DVDs/Childrens
46   rip_opts="$rip_opts"
47 elif [ "$dvdtype" == "childrens" ]; then
48   echo "-> Ripping Church DVD"
49   dest=/myth/video/DVDs/Church
50   rip_opts="$rip_opts"
51 else
52   echo '-E- Must specify dvdtype as "netflix" or "collection" or "childrens" or "church"'
53   usage
54 fi
55
56 ##############################################
57 # Display progress window
58
59 # Pop up an xterm window and run the script inside of it
60 echo "xterm -T \"Ripping->$dvdname\" -geometry 72x15+20+10 -bg black -fg white -e \"/bin/bash\" -c \"$ripcmd -d $dest $rip_opts\" &"
61 xterm -T "Ripping->$dvdname" -geometry 72x15+20+10 -bg black -fg white -e "/bin/bash" -c "$ripcmd -d $dest $rip_opts" &
62
63 ##############################################
64 # OR display the script output directly in the terminal it's called from
65 #$ripcmd -d $dest $rip_opts
66
67 ##############################################