Last active
July 23, 2017 19:32
-
-
Save rwenz3l/2b1009110b545fcb6cc065ee095c9d16 to your computer and use it in GitHub Desktop.
Verify a FLAC Folder ripped with XLD
This file contains hidden or 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
# 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