#!/bin/bash if [ "$EUID" -ne 0 ]; then echo "please run as root!" exit 1 fi if [ -z "$1" ]; then echo "specify a go version to update to" exit 1 fi echo "Downloading new Go version..." wget -P /home/marcy/ "https://go.dev/dl/go$1.linux-amd64.tar.gz" echo "Removing current Go installation..." rm -rf /usr/local/go echo "Installing new Go version..." tar -C /usr/local -xzf "/home/marcy/go$1.linux-amd64.tar.gz" echo "Cleaning up..." rm "/home/marcy/go$1.linux-amd64.tar.gz" echo "Done!"