-
Notifications
You must be signed in to change notification settings - Fork 62
/
get_models.sh
25 lines (22 loc) · 688 Bytes
/
get_models.sh
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
#!/bin/bash
URL=https://people.eecs.berkeley.edu/~akar/lsm/models_lsm_v1_small.tar.gz
CHECKSUM=8955572bb300a52a8b0dcf78d7e47b19
FILE=models_lsm_v1_small.tar.gz
if [ -f $FILE ]; then
echo "File already exists. Checking md5..."
os=`uname -s`
if [ "$os" = "Linux" ]; then
checksum=`md5sum $FILE | awk '{ print $1 }'`
elif [ "$os" = "Darwin" ]; then
checksum=`cat $FILE | md5`
fi
if [ "$checksum" = "$CHECKSUM" ]; then
echo "Checksum is correct. No need to download."
exit 0
else
echo "Checksum is incorrect. Need to download again."
fi
fi
wget $URL -O $FILE
tar xvzf $FILE
echo "Done. Please run this command again to verify that checksum = $CHECKSUM."