Actualizado chd_from_7z.sh

This commit is contained in:
2022-12-10 22:02:06 +01:00
parent 56811954bf
commit 173cbda794
+16 -13
View File
@@ -1,28 +1,31 @@
#!/bin/bash
###place this script into root folder that contains .7z PSX archives
###may need to chmod +x file to make executable
## Place this script into root folder that contains .7z archives
## May need to chmod +x file to make executable
###uncomment below if required software not on system
## Uncomment below if required software not on system
#sudo apt-get install -y mame-tools p7zip-full
#extract 7z
## Extract 7z
for x7zFile in *.7z; do
gameName="$(basename "$x7zFile" .7z)"
echo "!!!!!!!!!!Extracting ${gameName}..."
echo ">> Extracting ${gameName}"
7z x "${x7zFile}" -o./"${gameName}-tmp"
#convet to chd
echo "!!!!!!!!!!Converting ${gameName}..."a
chdman createcd -i "./${gameName}-tmp/${gameName}cue" -o ./"${gameName}.chd"
## Convet to chd
echo ">> Converting ${gameName}"
chdman createcd -i "./${gameName}-tmp/${gameName}.cue" -o ./"${gameName}.chd"
#rm temporary directory
## Delete temporary directory
rm -R ./"${gameName}-tmp"
### uncomment below to rm the original 7z archive
#rm ./"$x7zFile"
echo "!!!!!!!!!!${gameName} complete..."
## Delete original 7z archive
if [ -f ./"${gameName}.chd" ]; then
rm ./"$x7zFile"
echo ">> ${gameName} complete"
else
echo ">> ${gameName} failed"
fi
done