]> git.rmz.io Git - dotfiles.git/blob - bin/batch2iso
lazyvim: absorb keymaps
[dotfiles.git] / bin / batch2iso
1 #! /bin/bash
2
3 if [[ $# > 1 ]]; then
4 echo "This script accepts at most 1 Argument!" >&2
5 exit 0;
6 fi
7
8 DIR=${1:-.}
9 for F in $DIR/*; do
10 if [ -f "$F" ]; then
11 E=${F: -3}
12 N=`basename "$F" .$E`
13 case "$E" in
14 "bin")
15 hash bchunk 2>&- || { echo >&2 "I require bchunck but it's not installed. Aborting."; exit 1; }
16 if [[ -e "$N.cue" ]]; then
17 bchunk $F $N.cue $N.iso
18 echo $N
19 else
20 echo "No cue-sheet found! Please convert manually." >&2
21 fi
22 ;;
23 "mdf")
24 hash mdf2iso 2>&- || { echo >&2 "I require mdf2iso but it's not installed. Aborting."; exit 1; }
25 mdf2iso "$F" "$N.iso"
26 ;;
27 "nrg")
28 hash nrg2iso 2>&- || { echo >&2 "I require nrg2iso but it's not installed. Aborting."; exit 1; }
29 nrg2iso "$F" "$N.iso"
30 ;;
31 "img")
32 hash ccd2iso 2>&- || { echo >&2 "I require ccd2iso but it's not installed. Aborting."; exit 1; }
33 ccd2iso "$F" "$N.iso"
34 ;;
35 esac
36 fi
37 done