summaryrefslogtreecommitdiffstats
path: root/scripts/download.sh
blob: 831c4826c65038613d0eb348260d0db3f4040011 (plain)
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
#!/usr/bin/env bash

VERSION=1.2.15

download() {
    archive=gotop_${VERSION}_${1}.tgz
    curl -LO https://github.com/cjbassi/gotop/releases/download/$VERSION/$archive
    tar xf $archive
    rm $archive
}

arch=$(uname -sm)
case "$arch" in
    # order matters
    Linux\ armv5*)      download linux_arm5     ;;
    Linux\ armv6*)      download linux_arm6     ;;
    Linux\ armv7*)      download linux_arm7     ;;
    Linux\ armv8*)      download linux_arm8     ;;
    Linux\ aarch64*)    download linux_arm8     ;;
    Linux\ *64)         download linux_amd64    ;;
    Linux\ *86)         download linux_386      ;;
    *)
        echo "\
No binary found for your system.
Feel free to request that we prebuild one that works on your system."
        exit 1
        ;;
esac