download_data.sh 892 字节
Newer Older
Y
Yibing Liu 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
ubuntu_url=http://dam-data.cdn.bcebos.com/ubuntu.tar.gz
ubuntu_md5=9d7db116a040530a16f68dc0ab44e4b6

if  [ ! -e ubuntu.tar.gz ]; then
    wget -c $ubuntu_url
fi

echo "Checking md5 sum ..."
md5sum_tmp=`md5sum ubuntu.tar.gz | cut -d ' ' -f1`

if [ $md5sum_tmp !=  $ubuntu_md5 ]; then
    echo "Md5sum check failed, please remove and redownload ubuntu.tar.gz"
    exit 1
fi

echo "Untar ubuntu.tar.gz ..."

tar -xzvf ubuntu.tar.gz 
mv data ubuntu

douban_url=http://dam-data.cdn.bcebos.com/douban.tar.gz
douban_md5=e07ca68f21c20e09efb3e8b247194405

if  [ ! -e douban.tar.gz ]; then
    wget -c $douban_url
fi

echo "Checking md5 sum ..."
md5sum_tmp=`md5sum douban.tar.gz | cut -d ' ' -f1`

if [ $md5sum_tmp !=  $douban_md5 ]; then
    echo "Md5sum check failed, please remove and redownload douban.tar.gz"
    exit 1
fi

echo "Untar douban.tar.gz ..."

tar -xzvf douban.tar.gz 
mv data douban