mirror of
https://github.com/amiaopensource/ffmprovisr.git
synced 2025-03-26 12:55:29 +01:00
revision
- added some { } - added test diff only if Cygwin - integrated version in help - added please wait message - updated version
This commit is contained in:
parent
a0e9925640
commit
d7bd3fb74b
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
SCRIPT=$(basename $0)
|
SCRIPT=$(basename "${0}")
|
||||||
VERSION='2016-07-10'
|
VERSION='2016-07-23'
|
||||||
AUTHOR='ffmprovisr'
|
AUTHOR='ffmprovisr'
|
||||||
RED='\033[1;31m'
|
RED='\033[1;31m'
|
||||||
BLUE='\033[1;34m'
|
BLUE='\033[1;34m'
|
||||||
@ -8,32 +8,29 @@
|
|||||||
|
|
||||||
output_prompt() {
|
output_prompt() {
|
||||||
cat <<END_OF_MSG
|
cat <<END_OF_MSG
|
||||||
Usage: $SCRIPT [-h | <av_file> <md5_file>]
|
Usage: ${SCRIPT} [-h | <av_file> <md5_file>]
|
||||||
END_OF_MSG
|
|
||||||
}
|
|
||||||
|
|
||||||
output_version() {
|
|
||||||
cat <<END_OF_MSG
|
|
||||||
$SCRIPT $VERSION $AUTHOR
|
|
||||||
END_OF_MSG
|
END_OF_MSG
|
||||||
}
|
}
|
||||||
|
|
||||||
output_help() {
|
output_help() {
|
||||||
cat <<END_OF_MSG
|
cat <<END_OF_MSG
|
||||||
Syntax:
|
Syntax:
|
||||||
$SCRIPT
|
${SCRIPT}
|
||||||
Prompts a short help message.
|
Prompts a short help message.
|
||||||
$SCRIPT -h
|
${SCRIPT} -h
|
||||||
This help.
|
This help.
|
||||||
$SCRIPT <av_file> <md5_file>
|
${SCRIPT} <av_file> <md5_file>
|
||||||
Pass to the script the audio-visual file and the corresponding MD5
|
Pass to the script the audio-visual file and the corresponding MD5
|
||||||
file to check.
|
file to check.
|
||||||
Dependency:
|
Dependency:
|
||||||
ffmpeg
|
ffmpeg
|
||||||
|
About:
|
||||||
|
Version: ${VERSION}
|
||||||
|
Website: https://github.com/amiaopensource/ffmprovisr/blob/gh-pages/check_framemd5.sh
|
||||||
END_OF_MSG
|
END_OF_MSG
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ ! $(which diff) ] ; then
|
if [[ $OSTYPE == "cygwin" ]] || [ ! $(which diff) ] ; then
|
||||||
echo -e "${RED}ERROR:${NC} diff is not installed by default. Please install diffutils from Cygwin."
|
echo -e "${RED}ERROR:${NC} diff is not installed by default. Please install diffutils from Cygwin."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@ -45,9 +42,6 @@ elif [ "$#" -eq 1 ]; then
|
|||||||
if [ "$1" == '-h' ]; then
|
if [ "$1" == '-h' ]; then
|
||||||
output_help
|
output_help
|
||||||
exit 0
|
exit 0
|
||||||
elif [ "$1" == '-v' ]; then
|
|
||||||
output_version
|
|
||||||
exit 0
|
|
||||||
else
|
else
|
||||||
echo -e "${RED}ERROR:${NC} '$1' is an invalid argument."
|
echo -e "${RED}ERROR:${NC} '$1' is an invalid argument."
|
||||||
output_prompt
|
output_prompt
|
||||||
@ -68,6 +62,7 @@ elif [ "$#" -eq 2 ]; then
|
|||||||
else
|
else
|
||||||
md5_tmp="$HOME/$(basename $2).tmp"
|
md5_tmp="$HOME/$(basename $2).tmp"
|
||||||
fi
|
fi
|
||||||
|
echo "Please wait..."
|
||||||
$(ffmpeg -y -i $1 -loglevel 0 -f framemd5 -an $md5_tmp)
|
$(ffmpeg -y -i $1 -loglevel 0 -f framemd5 -an $md5_tmp)
|
||||||
old_file=$(grep -v '^#' $2)
|
old_file=$(grep -v '^#' $2)
|
||||||
tmp_file=$(grep -v '^#' $md5_tmp)
|
tmp_file=$(grep -v '^#' $md5_tmp)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user