Created
December 17, 2023 00:06
-
-
Save superjamie/e422469287189342db31312e2d70c5fd to your computer and use it in GitHub Desktop.
iso2chd - Bash script to convert ISO to CHD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -z "$1" ]; then | |
echo "Usage: $0 ISO|CUE" | |
echo " Converts input file to same-name CHD" | |
exit | |
fi | |
if ! [ -x "$(which chdman)" ]; then | |
echo "ERROR: Need chdman. Install mame-tools." | |
exit | |
fi | |
if ! [ -f "$1" ]; then | |
echo "ERROR: Input file \"$1\" does not exist" | |
exit | |
fi | |
INPUT="$1" | |
#echo "DEBUG: Input = \"$INPUT\"" | |
TARGET="${INPUT%.*}.chd" | |
#echo "DEBUG: Target = \"$TARGET\"" | |
if [ -f "$TARGET" ]; then | |
echo "ERROR: Output file \"$TARGET\" already exists" | |
exit | |
fi | |
chdman createcd -i "$INPUT" -o "$TARGET" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment