#!/bin/sh
#                 /usr/local/bin/rip_dvd
# http://crystalfaeries.net/posix/bin/rip_dvd
# celeste:crystalfaery 2014-03-22 22:46:46+00:00
# adapted from bash code at http://people.skolelinux.org/pere/blog/
# comment-out the next line after first successful run:
sudo apt-get install lsdvd dvdbackup genisoimage || exit "$?"
set -e
outdir=/home/video/dvd/
tmpdir=/var/tmp/
# I'm guessing lsdvd will give us titles with " "s and non-ASCII:
title=$(lsdvd 2>/dev/null|awk '/Disc Title: / {print $3}')		&& \
dvdbackup -i /dev/dvd -M -o "$tmpdir" -n"$title"			&& \
genisoimage -dvd-video -o "$outdir"/"$title".iso "$tmpdir"/"$title"	&& \
rm -rf "$tmpdir"/"$title"						&& \
name_tidy "$outdir"	# does this have a '--quiet' option?
exit $?


syntax highlighted by Code2HTML, v. 0.9.1