install-sharness.sh 628 Bytes
Newer Older
Juan Batiz-Benet's avatar
Juan Batiz-Benet committed
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
#!/bin/sh
# install sharness.sh
#
# Copyright (c) 2014 Juan Batiz-Benet
# MIT Licensed; see the LICENSE file in this repository.
#

# settings
version=50229a79ba22b2f13ccd82451d86570fecbd194c
hash1=eeaf96630fc25ec58fb678b64ef9772d5eb92f64
url=https://raw.githubusercontent.com/mlafeldt/sharness/$version/sharness.sh
file=sharness.sh

# 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"
  rm $file.test
  exit -1
fi

# ok, move it into place
mv $file.test $file
exit 0