Created
July 13, 2023 21:34
-
-
Save heatxsink/66f2fedaefeeea9bfc3a86fbf1cf0814 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 | |
#### | |
# Example usage ... | |
# | |
# sudo ./go-upgrade.sh https://go.dev/dl/go1.18.linux-amd64.tar.gz | |
# | |
### | |
if [ $# -eq 0 ] | |
then | |
echo "No arguments supplied." | |
exit 1 | |
fi | |
FETCH_URL=$1 | |
UPDATE_FILENAME="golang.update.tar.gz" | |
wget $FETCH_URL -O $UPDATE_FILENAME | |
rm -rf /usr/local/go | |
tar -C /usr/local -xzf $UPDATE_FILENAME | |
rm -rf $UPDATE_FILENAME | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment