mirror of
https://github.com/ipfs/kubo.git
synced 2025-07-01 19:24:14 +08:00
install aggregate-results.sh too
This commit is contained in:
@ -7,22 +7,43 @@
|
|||||||
|
|
||||||
# settings
|
# settings
|
||||||
version=50229a79ba22b2f13ccd82451d86570fecbd194c
|
version=50229a79ba22b2f13ccd82451d86570fecbd194c
|
||||||
hash1=eeaf96630fc25ec58fb678b64ef9772d5eb92f64
|
urlprefix=https://raw.githubusercontent.com/mlafeldt/sharness/$version
|
||||||
url=https://raw.githubusercontent.com/mlafeldt/sharness/$version/sharness.sh
|
|
||||||
file=sharness.sh
|
|
||||||
|
|
||||||
# download it
|
# files to download
|
||||||
wget -q $url -O $file.test
|
sfile=sharness.sh
|
||||||
|
shash=eeaf96630fc25ec58fb678b64ef9772d5eb92f64
|
||||||
|
|
||||||
# verify it's the right file
|
afile=aggregate-results.sh
|
||||||
hash2=`cat $file.test | shasum | cut -c1-40`
|
ahash=948d6bc03222c5c00a1ed048068508d5ea1cce59
|
||||||
if test "$hash1" != "$hash2"; then
|
|
||||||
echo "$file verification failed"
|
verified_download() {
|
||||||
echo "$hash1 != $hash2"
|
file=$1
|
||||||
rm $file.test
|
hash1=$2
|
||||||
|
url=$urlprefix/$file
|
||||||
|
|
||||||
|
# download it
|
||||||
|
wget -q $url -O $file.test
|
||||||
|
|
||||||
|
# verify it's the right file
|
||||||
|
hash2=`cat $file.test | shasum | cut -c1-40`
|
||||||
|
if test "$hash1" != "$hash2"; then
|
||||||
|
echo "$file verification failed:"
|
||||||
|
echo " $hash1 != $hash2"
|
||||||
|
return -1
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
verified_download "$sfile" "$shash"; sok=$?
|
||||||
|
verified_download "$afile" "$ahash"; aok=$?
|
||||||
|
if test "$sok" != 0 || test "$aok" != 0; then
|
||||||
|
rm $afile.test
|
||||||
|
rm $sfile.test
|
||||||
exit -1
|
exit -1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ok, move it into place
|
# ok, move things into place
|
||||||
mv $file.test $file
|
mv $sfile.test $sfile
|
||||||
|
mv $afile.test $afile
|
||||||
exit 0
|
exit 0
|
||||||
|
Reference in New Issue
Block a user