1
0
mirror of https://github.com/rancher/os-kernel.git synced 2025-06-22 19:57:03 +00:00
os-kernel/scripts/download

42 lines
707 B
Plaintext
Raw Normal View History

2015-08-05 16:53:05 +00:00
#!/bin/bash
set -e
set -x
cd $(dirname $0)/..
: ${ARTIFACTS:=$(pwd)/assets}
check()
{
local hash=$1
local file=$2
if [ ! -e "$file" ]; then
return 1
fi
CURRENT=$(sha1sum $file | awk '{print $1}')
[ "$hash" = "$CURRENT" ]
}
download()
{
mkdir -p ${ARTIFACTS}
local url=$2
local file=${ARTIFACTS}/$(basename $2)
local hash=$1
if ! check $hash $file; then
curl -sL $url > $file
fi
if ! check $hash $file; then
echo "ERROR: $file does not match checksum $hash, got $CURRENT" 1>&2
return 1
fi
}
2015-08-21 11:29:24 +00:00
download 84b9bc53bbb4dd465b97ea54a71a9805e27ae4f2 https://github.com/rancher/linux/archive/Ubuntu-3.19.0-27.29.tar.gz