#!/bin/bash
if [ ! -n "$2" ]; then
echo $0: 0/1 dir
exit 1
fi
DRIVE=$1
shift
DESTDIR="$HOME/Videos/mpg/$1"
shift
if [ ! -d "$DESTDIR" ]; then
mkdir -p "$DESTDIR" || exit 1
fi
cd "$DESTDIR" && \
/bin/rm -f * && \
/usr/bin/vcdxrip $* -C /dev/scd$DRIVE && \
eject /dev/scd$DRIVE && echo vcdxrip successfully && exit 0
echo vcdxrip fail || exit 1