Skip to content
Snippets Groups Projects
Unverified Commit 9faf6f07 authored by Jan Buethe's avatar Jan Buethe
Browse files

added sha256 check for downloaded data

parent ddbe4838
No related branches found
No related tags found
No related merge requests found
...@@ -9,7 +9,7 @@ set -e ...@@ -9,7 +9,7 @@ set -e
srcdir=`dirname $0` srcdir=`dirname $0`
test -n "$srcdir" && cd "$srcdir" test -n "$srcdir" && cd "$srcdir"
dnn/download_model.sh "735117b" dnn/download_model.sh "8f34305a299183509d22c7ba66790f67916a0fc56028ebd4c8f7b938458f2801"
echo "Updating build configuration files, please wait...." echo "Updating build configuration files, please wait...."
......
...@@ -7,4 +7,25 @@ if [ ! -f $model ]; then ...@@ -7,4 +7,25 @@ if [ ! -f $model ]; then
echo "Downloading latest model" echo "Downloading latest model"
wget https://media.xiph.org/opus/models/$model wget https://media.xiph.org/opus/models/$model
fi fi
SHA256=$(command -v sha256sum)
if [ "$?" != "0" ]
then
echo "Could not find sha256 sum. Skipping verification. Please verify manually that sha256 hash of ${model} matches ${1}."
else
echo "Validating checksum"
checksum=$1
checksum2=$(sha256sum $model | awk '{print $1}')
if [ "$checksum" != "$checksum2" ]
then
echo "checksums don't match, aborting"
exit 1
else
echo "checksums match"
fi
fi
tar xvomf $model tar xvomf $model
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment