Created
December 6, 2013 22:10
-
-
Save deckerego/7833003 to your computer and use it in GitHub Desktop.
Check your Ogg Vorbis files and ensure they're not corrupted.
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
#!/bin/bash | |
BASEDIR=$1 | |
if [ -z "$BASEDIR" ] ; then | |
echo "Usage: oggcheck directory" | |
exit -1 | |
fi | |
if [ ! -d "$BASEDIR" ] ; then | |
echo "Directory $BASEDIR not found" | |
exit -1 | |
fi | |
DIRLIST=`ls -1d "$BASEDIR/"*` | |
IFS=" | |
" | |
for DIRECTORY in $DIRLIST ; do | |
[ ! -d "$DIRECTORY" ] && continue | |
OGGFILES=`ls -1d "$DIRECTORY/"*.ogg` | |
for OGGFILE in $OGGFILES ; do | |
WARNING=`ogginfo "$OGGFILE" | grep -E 'arning|bug'` | |
if [[ ! -z "$WARNING" ]] ; then | |
echo "$DIRECTORY is corrupt." | |
break | |
fi | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment