summaryrefslogtreecommitdiffstats
path: root/install.sh
blob: a14e832e7e3417c442f6d6030806f6484037d194 (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
29
30
#!/bin/bash

VERSION=v1.0

download() {
    curl -L https://github.com/cjbassi/gotop/releases/download/$VERSION/${1} > /usr/bin/gotop
    chmod +x /usr/bin/gotop
}

uninstall() {
    rm /usr/bin/gotop
}

for opt in "$@"; do
  case $opt in
    --uninstall)
      uninstall
      exit 0
      ;;
    *)
      echo "unknown option: $opt"
      exit 1
      ;;
  esac
done

arch=$(uname -sm)
case "$arch" in
  Linux\ *64)   download gotop-linux_amd64  ;;
esac