You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
497 B
21 lines
497 B
download() {
|
|
URL=$1
|
|
MD5=$2
|
|
TARGET=$3
|
|
|
|
if [ -e $TARGET ]; then
|
|
md5_result=`md5sum $TARGET | awk -F[' '] '{print $1}'`
|
|
if [ $MD5 == $md5_result ]; then
|
|
echo "$TARGET already exists, download skipped."
|
|
return 0
|
|
fi
|
|
fi
|
|
|
|
wget -c $URL -P `dirname "$TARGET"`
|
|
md5_result=`md5sum $TARGET | awk -F[' '] '{print $1}'`
|
|
if [ $MD5 == $md5_result ]; then
|
|
echo "Fail to download the language model!"
|
|
return 1
|
|
fi
|
|
}
|