Skip to content

Commit 9faf6f0

Browse files
author
Jan Buethe
committed
added sha256 check for downloaded data
1 parent ddbe483 commit 9faf6f0

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

autogen.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ set -e
99
srcdir=`dirname $0`
1010
test -n "$srcdir" && cd "$srcdir"
1111

12-
dnn/download_model.sh "735117b"
12+
dnn/download_model.sh "8f34305a299183509d22c7ba66790f67916a0fc56028ebd4c8f7b938458f2801"
1313

1414
echo "Updating build configuration files, please wait...."
1515

dnn/download_model.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,25 @@ if [ ! -f $model ]; then
77
echo "Downloading latest model"
88
wget https://media.xiph.org/opus/models/$model
99
fi
10+
11+
SHA256=$(command -v sha256sum)
12+
if [ "$?" != "0" ]
13+
then
14+
echo "Could not find sha256 sum. Skipping verification. Please verify manually that sha256 hash of ${model} matches ${1}."
15+
else
16+
echo "Validating checksum"
17+
checksum=$1
18+
checksum2=$(sha256sum $model | awk '{print $1}')
19+
if [ "$checksum" != "$checksum2" ]
20+
then
21+
echo "checksums don't match, aborting"
22+
exit 1
23+
else
24+
echo "checksums match"
25+
fi
26+
27+
fi
28+
29+
30+
1031
tar xvomf $model

0 commit comments

Comments
 (0)