2018-02-20 03:30:38 +08:00
|
|
|
#!/usr/bin/env bash
|
2018-02-19 16:22:14 +08:00
|
|
|
|
2018-04-13 23:54:53 +08:00
|
|
|
VERSION=1.2.11
|
2018-02-19 16:22:14 +08:00
|
|
|
|
2018-02-27 04:55:05 +08:00
|
|
|
download() {
|
2018-04-10 10:02:46 +08:00
|
|
|
archive=gotop_${VERSION}_${1}.tgz
|
2018-04-10 09:07:36 +08:00
|
|
|
curl -LO https://github.com/cjbassi/gotop/releases/download/$VERSION/$archive
|
|
|
|
tar xf $archive
|
|
|
|
rm $archive
|
2018-02-19 17:59:51 +08:00
|
|
|
}
|
2018-02-20 10:11:00 +08:00
|
|
|
|
|
|
|
arch=$(uname -sm)
|
|
|
|
case "$arch" in
|
2018-02-27 04:55:05 +08:00
|
|
|
Linux\ *64) download linux_amd64 ;;
|
|
|
|
Linux\ *86) download linux_386 ;;
|
|
|
|
Darwin\ *64) download darwin_amd64 ;;
|
2018-04-11 11:25:14 +08:00
|
|
|
Darwin\ *86) download darwin_386 ;;
|
2018-02-20 10:11:00 +08:00
|
|
|
*)
|
2018-02-23 06:42:26 +08:00
|
|
|
echo "No binary found for your system"
|
2018-02-20 10:11:00 +08:00
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|