Skip to content

Instantly share code, notes, and snippets.

@rwenz3l
Last active July 23, 2017 19:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rwenz3l/2b1009110b545fcb6cc065ee095c9d16 to your computer and use it in GitHub Desktop.
Save rwenz3l/2b1009110b545fcb6cc065ee095c9d16 to your computer and use it in GitHub Desktop.
Verify a FLAC Folder ripped with XLD
# crc32 <(flac --decode --stdout --force-raw-format --endian=little --sign=signed /path/to/file.flac)
function veriflac() {
NC='\033[0m'
Red='\033[0;31m'
Green='\033[0;32m'
if [ $# -eq 0 ]
then
echo -e "${Red}Usage:"
echo -e " veriflac /path/to/folder${NC}";
return 0;
fi
for f in "${1}"/*.flac; do
echo -e "--> Checking: $(basename "${f}")"
checksum=$(crc32 <(flac --silent --decode --stdout --force-raw-format --endian=little --sign=signed "${f}"))
grep -i "${checksum}" "${1}"/*.log
if [[ $(grep -i "${checksum}" "${1}"/*.log) ]]; then
echo -e "${Green} --> Verified: $(basename "${f}") ${NC}"
else
echo -e "${Red} --> Error: ${checksum} on ${f} ${NC}"
fi
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment