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