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.
20 lines
437 B
20 lines
437 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 -O "$TARGET"
|
|
md5_result=`md5sum $TARGET | awk -F[' '] '{print $1}'`
|
|
if [ ! $MD5 == $md5_result ]; then
|
|
return 1
|
|
fi
|
|
}
|