Last active
July 21, 2021 18:31
-
-
Save Sinistral2099/bc1f8ea023faadb572bd2e97981a340e to your computer and use it in GitHub Desktop.
Bash scripts for managing ROM files
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 | |
version="0.2" | |
if [ "$#" -ne 1 ]; then | |
echo "Usage: $(basename $0) [7z file]" | |
exit 0 | |
fi | |
function error() { | |
echo -n "$SCRIPTNAME: ERROR occured in line $1: " | |
shift | |
echo "$@" | |
} | |
echo ${0##.*} $version | |
#Usage Checks | |
for command in 7z; do | |
command -v $command >/dev/null 2>&1 | |
if (( $? != 0 )); then | |
error $LINENO "$command is not installed." | |
exit -4 | |
fi | |
done | |
tempdir=$(mktemp -d) | |
7z e "$1" -o"${tempdir}/" -y | |
7z a "${1%.*}.zip" "${tempdir}/*" | |
rm -rf "${tempdir}" |
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 | |
version="0.3" | |
if [ "$#" -ne 1 ]; then | |
echo "Usage: $(basename $0) [cue file]" | |
exit 0 | |
fi | |
function error() { | |
echo -n "$SCRIPTNAME: ERROR occured in line $1: " | |
shift | |
echo "$@" | |
} | |
echo ${0##.*} $version | |
#Usage Checks | |
for command in chdman; do | |
command -v $command >/dev/null 2>&1 | |
if (( $? != 0 )); then | |
error $LINENO "$command is not installed." | |
exit -4 | |
fi | |
done | |
chdmad createcd -i "$1" -o "${1%.*}.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 | |
version="0.3" | |
if [ "$#" -ne 1 ]; then | |
echo "Usage: $(basename $0) [compressed bincue file]" | |
exit 0 | |
fi | |
function error() { | |
echo -n "$SCRIPTNAME: ERROR occured in line $1: " | |
shift | |
echo "$@" | |
} | |
echo ${0##.*} $version | |
#Usage Checks | |
for command in 7z chdman mktemp; do | |
command -v $command >/dev/null 2>&1 | |
if (( $? != 0 )); then | |
error $LINENO "$command is not installed." | |
exit -4 | |
fi | |
done | |
temp=$(mktemp -d) | |
7z e "$1" -o"$temp" -y | |
chdman createcd -i "$temp/${1%.*}.cue" -o "$PWD/${1%.*}.chd" -f | |
rm -rf "$temp" |
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 | |
version="0.2" | |
if [ "$#" -ne 1 ]; then | |
echo "Usage: $(basename $0) [compressed bincue file]" | |
exit 0 | |
fi | |
function error() { | |
echo -n "$SCRIPTNAME: ERROR occured in line $1: " | |
shift | |
echo "$@" | |
} | |
echo ${0##.*} $version | |
#Usage Checks | |
for command in 7z binmerge; do | |
command -v $command >/dev/null 2>&1 | |
if (( $? != 0 )); then | |
error $LINENO "$command is not installed." | |
exit -4 | |
fi | |
done | |
temp=$(mktemp -d) | |
7z e "$1" -o"$temp" -y | |
binmerge -o "$PWD" "$temp/${1%.*}.cue" "${1%.*}" | |
rm -rf "$temp" |
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 | |
version="0.2" | |
if [ "$#" -ne 1 ]; then | |
echo "Usage: $(basename $0) [compressed gdi file]" | |
exit 0 | |
fi | |
function error() { | |
echo -n "$SCRIPTNAME: ERROR occured in line $1: " | |
shift | |
echo "$@" | |
} | |
echo ${0##.*} $version | |
#Usage Checks | |
for command in 7z chdman; do | |
command -v $command >/dev/null 2>&1 | |
if (( $? != 0 )); then | |
error $LINENO "$command is not installed." | |
exit -4 | |
fi | |
done | |
temp=$(mktemp -d) | |
7z e "$1" -o"$temp" -y | |
chdman createcd -i "$temp/${filename%.*}.gdi" -o "$PWD/${filename%.*}.chd" -f | |
rm -rf "$temp" | |
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 | |
version="0.2" | |
if [ "$#" -ne 1 ]; then | |
echo "Usage: $(basename $0) [gdi file]" | |
exit 0 | |
fi | |
function error() { | |
echo -n "$SCRIPTNAME: ERROR occured in line $1: " | |
shift | |
echo "$@" | |
} | |
echo ${0##.*} $version | |
#Usage Checks | |
for command in chdman; do | |
command -v $command >/dev/null 2>&1 | |
if (( $? != 0 )); then | |
error $LINENO "$command is not installed." | |
exit -4 | |
fi | |
done | |
chdman createcd -i "$1" -o "${1%.*}.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 | |
version="0.2" | |
if [ "$#" -ne 1 ]; then | |
echo "Usage: $(basename $0) [zip file]" | |
exit 0 | |
fi | |
function error() { | |
echo -n "$SCRIPTNAME: ERROR occured in line $1: " | |
shift | |
echo "$@" | |
} | |
echo ${0##.*} $version | |
#Usage Checks | |
for command in 7z; do | |
command -v $command >/dev/null 2>&1 | |
if (( $? != 0 )); then | |
error $LINENO "$command is not installed." | |
exit -4 | |
fi | |
done | |
tempdir=$(mktemp -d) | |
7z e "$1" -o"${tempdir}/" -y | |
7z a "${1%.*}.7z" "${tempdir}/*" | |
rm -rf "${tempdir}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment