1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-11-16 22:35:04 -05:00

Verify SHA1 hash when updating to the latest FileBot.jar revision

This commit is contained in:
Reinhard Pointner 2016-06-08 20:40:29 +08:00
parent 7b374a3a42
commit ccc2464aa1

View File

@ -27,7 +27,7 @@ JAR_FILE="$APP_ROOT/FileBot.jar"
JAR_URL="https://sourceforge.net/projects/filebot/files/filebot/HEAD/FileBot.jar" JAR_URL="https://sourceforge.net/projects/filebot/files/filebot/HEAD/FileBot.jar"
# check if file has changed # check if file has changed
JAR_SHA1_EXPECTED=`curl "$JAR_URL/list" | egrep -o "[a-z0-9]{40}"` JAR_SHA1_EXPECTED=`curl --retry 5 "$JAR_URL/list" | egrep -o "[a-z0-9]{40}"`
JAR_SHA1=`sha1sum $JAR_FILE | cut -d' ' -f1` JAR_SHA1=`sha1sum $JAR_FILE | cut -d' ' -f1`
if [ "$JAR_SHA1" == "$JAR_SHA1_EXPECTED" ]; then if [ "$JAR_SHA1" == "$JAR_SHA1_EXPECTED" ]; then
@ -36,7 +36,7 @@ if [ "$JAR_SHA1" == "$JAR_SHA1_EXPECTED" ]; then
fi fi
echo "Update $JAR_FILE" echo "Update $JAR_FILE"
curl -L -o "$JAR_FILE" -z "$JAR_FILE" "$JAR_URL" # FRS will redirect to (unsecure) HTTP download link curl -L -o "$JAR_FILE" -z "$JAR_FILE" --retry 5 "$JAR_URL" # FRS will redirect to (unsecure) HTTP download link
# check if file has been corrupted # check if file has been corrupted
JAR_SHA1=`sha1sum $JAR_FILE | cut -d' ' -f1` JAR_SHA1=`sha1sum $JAR_FILE | cut -d' ' -f1`