Initial commit

This commit is contained in:
Benjamyn Love 2019-05-26 21:40:14 +10:00
commit 6476b5b49d
3 changed files with 90 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
*-mkv/
out.log
*.iso

19
README.md Normal file
View File

@ -0,0 +1,19 @@
# AutoMKV
AutoMKV is a simple bash script that was designed to automate the conversion of ISO images to MKV
Usage is quite simple, most of the defaults are assumed but can be overritten
```bash
./convert.sh -i image.iso -t 0 -o mkvs
```
|Flags| Description|
|---------------|----------------------|
| -i \| --input | Input image file |
| -o \| --output | Output folder |
| -t \| --title | Title to dump |
| -h \| --help | Shows this help menu |
Requirements
https://www.makemkv.com/

68
convert.sh Executable file
View File

@ -0,0 +1,68 @@
#!/bin/bash
# Benjamyn Love
# 25/05/2019
# The script needs to have at minimum 2 args
#if [[ $# -le 1 ]]
#then
# printf "Expecting at least two args\n"
# printf "Usage: ./convert.sh inputfile title\n"
# exit
#fi
usage() {
printf ' -i | --input\t\t\tInput image file\n'
printf ' -o | --output\t\t\tOutput folder\n'
printf ' -t | --title\t\t\tTitle to dump\n'
printf ' -h | --help\t\t\tShows this help menu\n'
}
while [ "$1" != "" ]; do
case $1 in
-i | --input ) shift
INFILE=$1
;;
-t | --title ) shift
TITLE=$1
;;
-h | --help ) usage
exit
;;
-o | --output ) shift
OUTFOLDER=$1-mkv
;;
* ) usage
exit 1
esac
shift
done
if [[ -z $INFILE ]]
then
printf "Input missing please specify using -i\n"
exit
fi
if [[ -z $TITLE ]]
then
printf "Title missing assuming 0, specify with -t\n"
TITLE=0
fi
if [[ -z $OUTFOLDER ]]
then
printf "Output folder missing assuming input file -mkv"
OUTFOLDER=$INFILE-mkv
fi
echo "Converting ISO to MKV"
echo "Creating out folder $OUTFOLDER"
mkdir $OUTFOLDER
if [[ -f $INFILE ]]
then
printf "Starting conversion\n"
makemkvcon mkv --progress=-same iso:$INFILE $TITLE $OUTFOLDER/ | tee "out.log"
else
printf "File not found!\n"
fi