gotop/install.sh

23 lines
422 B
Bash
Raw Normal View History

2018-02-20 03:30:38 +08:00
#!/usr/bin/env bash
2018-02-19 16:22:14 +08:00
2018-02-19 17:59:51 +08:00
VERSION=1.0.0
2018-02-19 16:22:14 +08:00
2018-02-20 03:30:38 +08:00
arch=$(uname -sm)
case "$arch" in
Linux\ *64) exe=linux_amd64 ;;
esac
curl -L https://github.com/cjbassi/gotop/releases/download/$VERSION/gotop-$exe > /usr/bin/gotop
chmod +x /usr/bin/gotop
2018-02-19 16:55:31 +08:00
2018-02-19 17:59:51 +08:00
update() {
cur_version=$(gotop -v 2>/dev/null)
if [[ $? != 0 ]]; then
download
fi
if (( "${cur_version//.}" < "${VERSION//.}" )); then
download
fi
}