Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added script to install gotop without root #125

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ go build -o gotop ./cmd/gotop

Move `gotop` to somewhere in your `$PATH`.

This process can be automated with a simple shell script.
This may be useful for installing gotop on servers without root access.
See `install_without_root.sh`.

## Usage

Run with `-h` to get an extensive list of command line arguments. Many of these can be configured by creating a configuration file; see the next section for more information. Key bindings can be viewed while gotop is running by pressing the `?` key, or they can be printed out by using the `--list keys` command.
Expand Down
31 changes: 31 additions & 0 deletions install_without_root.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh

VERSION='1.14.2'
OS='linux'
ARCH='amd64'

GO_NAME=go${VERSION}.${OS}-${ARCH}

mkdir -p $HOME/pkg
cd $HOME/pkg

curl https://dl.google.com/go/${GO_NAME}.tar.gz --output ./${GO_NAME}.tar.gz

tar -vxzf ${GO_NAME}.tar.gz
rm ${GO_NAME}.tar.gz

PATH=$HOME/pkg/go/bin:$PATH

go env -w GOPATH=$HOME/pkg # otherwise go would create a directory in $HOME

rm -rf ./gotop
git clone https://github.com/xxxserxxx/gotop.git
cd ./gotop
go build -o gotop ./cmd/gotop

go clean -modcache # otherwise $HOME/pkg/pkg would need sudo permissions to remove

ln -sf $HOME/pkg/gotop/gotop $HOME/bin/gotop

rm -rf $HOME/pkg/go
rm -rf $HOME/pkg/pkg # installed as part of go