Created
June 29, 2021 20:07
-
-
Save jeromescuggs/48eb4e5ac1deb6b8b7ef512448129f40 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ -d $HOME/lab ]]; then | |
JRM_GODIR=$HOME/lab | |
else | |
JRM_GODIR=$HOME | |
fi | |
echo "installing Golang to /usr/local/go..." | |
# define go binaries for x86, arm64, arm7 | |
JRM_ARCH=`uname -m` | |
if [[ $JRM_ARCH == "aarch64" ]]; then | |
GO_DL=go1.15.linux-arm64.tar.gz | |
fi | |
if [[ $JRM_ARCH == "x86_64" ]]; then | |
GO_DL=go1.15.linux-amd64.tar.gz | |
fi | |
# determine computer cpu arch and grab correct binary | |
# if [[ $JRM_ARCH == "aarch64" ]]; then | |
# cd $JRM_DIR && wget https://golang.org/dl/$GO_DL | |
# fi | |
# if [[ $JRM_ARCH == "x86_64" ]]; then | |
# cd $JRM_DIR && wget https://golang.org/dl/$JRM_GO_LINUX | |
# fi | |
cd $JRM_GODIR && wget https://golang.org/dl/$GO_DL | |
# unzip to /go and install | |
tar -xvf $JRM_GODIR/$GO_DL | |
sudo mv $JRM_GODIR/go /usr/local | |
echo "creating binary and source Go directory in $HOME..." | |
mkdir -p $HOME/go | |
echo "Golang has been installed!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment