X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/4b06eb26103a8f0840915532fdf411ef82e9ad24..89cf694280e02442fb435d5fe516ac09783d776a:/bin/batch2iso?ds=sidebyside diff --git a/bin/batch2iso b/bin/batch2iso new file mode 100755 index 0000000..f95f18a --- /dev/null +++ b/bin/batch2iso @@ -0,0 +1,37 @@ +#! /bin/bash + +if [[ $# > 1 ]]; then + echo "This script accepts at most 1 Argument!" >&2 + exit 0; +fi + +DIR=${1:-.} +for F in $DIR/*; do + if [ -f "$F" ]; then + E=${F: -3} + N=`basename "$F" .$E` + case "$E" in + "bin") + hash bchunk 2>&- || { echo >&2 "I require bchunck but it's not installed. Aborting."; exit 1; } + if [[ -e "$N.cue" ]]; then + bchunk $F $N.cue $N.iso + echo $N + else + echo "No cue-sheet found! Please convert manually." >&2 + fi + ;; + "mdf") + hash mdf2iso 2>&- || { echo >&2 "I require mdf2iso but it's not installed. Aborting."; exit 1; } + mdf2iso "$F" "$N.iso" + ;; + "nrg") + hash nrg2iso 2>&- || { echo >&2 "I require nrg2iso but it's not installed. Aborting."; exit 1; } + nrg2iso "$F" "$N.iso" + ;; + "img") + hash ccd2iso 2>&- || { echo >&2 "I require ccd2iso but it's not installed. Aborting."; exit 1; } + ccd2iso "$F" "$N.iso" + ;; + esac + fi +done