mirror of
https://github.com/netvolt/LinuxRMM-Script.git
synced 2024-11-22 07:33:17 +01:00
Merge pull request #8 from Sympatron/main
Detect if go is already installed and skip installation
This commit is contained in:
commit
93dd87fd67
@ -124,28 +124,32 @@ go_url_arm64="https://go.dev/dl/go1.18.3.linux-arm64.tar.gz"
|
|||||||
go_url_armv6="https://go.dev/dl/go1.18.3.linux-armv6l.tar.gz"
|
go_url_armv6="https://go.dev/dl/go1.18.3.linux-armv6l.tar.gz"
|
||||||
|
|
||||||
function go_install() {
|
function go_install() {
|
||||||
## Installing golang
|
if ! command -v go &> /dev/null; then
|
||||||
case $system in
|
## Installing golang
|
||||||
amd64)
|
case $system in
|
||||||
wget -O /tmp/golang.tar.gz $go_url_amd64
|
amd64)
|
||||||
|
wget -O /tmp/golang.tar.gz $go_url_amd64
|
||||||
|
;;
|
||||||
|
x86)
|
||||||
|
wget -O /tmp/golang.tar.gz $go_url_x86
|
||||||
;;
|
;;
|
||||||
x86)
|
arm64)
|
||||||
wget -O /tmp/golang.tar.gz $go_url_x86
|
wget -O /tmp/golang.tar.gz $go_url_arm64
|
||||||
;;
|
;;
|
||||||
arm64)
|
armv6)
|
||||||
wget -O /tmp/golang.tar.gz $go_url_arm64
|
wget -O /tmp/golang.tar.gz $go_url_armv6
|
||||||
;;
|
;;
|
||||||
armv6)
|
esac
|
||||||
wget -O /tmp/golang.tar.gz $go_url_armv6
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
tar -xvzf /tmp/golang.tar.gz -C /usr/local/
|
tar -xvzf /tmp/golang.tar.gz -C /usr/local/
|
||||||
rm /tmp/golang.tar.gz
|
rm /tmp/golang.tar.gz
|
||||||
export GOPATH=/usr/local/go
|
export GOPATH=/usr/local/go
|
||||||
export GOCACHE=/root/.cache/go-build
|
export GOCACHE=/root/.cache/go-build
|
||||||
|
|
||||||
echo "Golang Install Done !"
|
echo "Golang Install Done !"
|
||||||
|
else
|
||||||
|
echo "Go is already installed"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function agent_compile() {
|
function agent_compile() {
|
||||||
|
Loading…
Reference in New Issue
Block a user