#!/bin/sh # Custom Settings - Change these to match your system # DVD Drive Device (usually /dev/dvd) -- should be passed in as parameter dvddevice="/dev/dvd" # Temporary Directory tmpdir="/myth/tmp/dvdbackup.$RANDOM" # MythVideo Directory in which to store resulting ISO file isodir="/myth/video" # Whether to play sounds at the beginning and ending of the operation playsounds="1" # Sounds to play when starting and stopping the rip startsound="/usr/share/sounds/beg.wav" endsound="/usr/share/sounds/end.wav" # Whether to force an unmount of the device for safety sake forceunmount="1" # Whether to eject the DVD after the copy is complete autoeject="1" # Whether to cleanup the DVD Backup directory temporary copy cleanup="1" ############################################### # DO NOT CHANGE ANYTHING BELOW THIS LINE # (or at least, do so at your own risk) # Make Temporary Folder mkdir -p $tmpdir # Audio Signal for Starting if test "$playsounds" == "1"; then echo Starting Opertation... play $startsound fi # Make Backup of DVD to Hard Disk Temporary Folder dvdbackup -i $dvddevice -o $tmpdir -M # Retrieve Name of DVD dvdname=`ls $tmpdir` echo Building ISO File for $dvdname... if test "$dvdname" != ""; then echo mkisofs -dvd-video -udf -V "$dvdname" $tmpdir"/"$dvdname > $isodir"/"$dvdname".iso" mkisofs -dvd-video -udf -V "$dvdname" $tmpdir"/"$dvdname > $isodir"/"$dvdname".iso" # Force Unmount of Device if test "$forceunmount" == "1"; then echo Unmounting Drive... umount $dvddevice fi # Eject Drive as a Visual Completion Cue if test "$autoeject" == "1"; then echo Ejecting Drive... eject $dvddevice fi # Clean Up Temporary Files if test "$cleanup" == "1"; then echo Cleaning Up Files... rm -rf $tmpdir fi # Audio Signal for Ending if test "$playsounds" == "1"; then echo Operation Complete. play $endsound fi else echo DVD Name not found in Temporary Directory $tmpdir - Directory not removed. echo Please manually confirm a good backup and run 'mkisofs' manually. echo Be sure to remove the Temporary Directory after the ISO is completed. fi