Created
July 9, 2022 17:14
-
-
Save wildcommunist/f7d7d73512eecae3f012fef68136731f 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 | |
# A basic installer script for new Virtual Machines by ceres ventures | |
red=$(tput setaf 1) | |
cyan=$(tput setaf 6) | |
green=$(tput setaf 2) | |
reset=$(tput sgr0) | |
GO_DL="https://dl.google.com/go/" | |
GO_VER="go1.18.2.linux-amd64.tar.gz" | |
GO_DL_LINK="$GO_DL$GO_VER" | |
BRC=~/.bashrc | |
sudo apt update | |
sudo apt install ntp nano curl jq wget git curl mc build-essential htop sshfs iputils-ping gcc net-tools -y | |
sudo timedatectl set-timezone Asia/Almaty | |
# This needs updating to specify the correct download path! | |
#curl https://gist.githubusercontent.com/wildcommunist/2a6b06b943ce1eff7415c77ae0233172/raw/e0fb60c4ba842968056fe3f04a2d989df0b4d62d/installnodeexp.sh | bash | |
wget "${GO_DL_LINK}" -P /tmp/ | |
# Remove old go install | |
if [ -d "/usr/local/go" ] | |
then | |
sudo rm -Rf /usr/local/go | |
fi | |
sudo tar -C /usr/local -xzf /tmp/$GO_VER | |
sudo rm /tmp/$GO_VER | |
if test -f "$BRC"; then | |
echo "$BRC exists." | |
echo '' >> $BRC | |
echo 'PATH=$PATH:/usr/local/go/bin' >> $BRC | |
echo 'PATH=$PATH:$(go env GOPATH)/bin' >> $BRC | |
fi | |
export PATH=$PATH:/usr/local/go/bin | |
export PATH=$PATH:$(go env GOPATH)/bin | |
echo "${cyan}Installed $(go version) successfully${reset}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment