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