#!/bin/sh
# Copyright (C) 2008 - 2013 vortexbox.org
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#

# Make sure makemkv is installed; if not, install it using yum

echo "Checking for makemkv..."
if [ ! -x /usr/bin/makemkvcon ]
then
	yum clean all
    yum -y install makemkv-lib makemkv-con
    if [ $? -ne 0 ]
    then
        echo "Error: Couldn't install makemkvcon"
        exit 1
    fi
fi

service vortexbox stop
echo ""
echo "Ripping DVD to /storage/movies..."
echo ""

/usr/bin/makemkvcon mkv --decrypt --progress=-stdout --minlength=3600 disc:0 all /storage/movies/

