From 27ff1180bd3ba40afd00f977729912a6bb9748a7 Mon Sep 17 00:00:00 2001
From: "Alexander A. Klimov" <alexander.klimov@icinga.com>
Date: Mon, 31 Jan 2022 15:52:39 +0000
Subject: [PATCH] Allow running icinga-provide-go $ARCH

as we need Go not only for amd64
---
 icinga-provide-go | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/icinga-provide-go b/icinga-provide-go
index aeef834..10acb5e 100755
--- a/icinga-provide-go
+++ b/icinga-provide-go
@@ -1,19 +1,20 @@
 #!/bin/bash
 
 VERSION_GO="1.16.5"
+ARCH_GO="${1:-amd64}"
 
 set -ex
 
 echo "Downloading Go Version ${VERSION_GO}"
-curl -LO https://golang.org/dl/go${VERSION_GO}.linux-amd64.tar.gz
+curl -LO https://golang.org/dl/go${VERSION_GO}.linux-${ARCH_GO}.tar.gz
 
 rm -rf /usr/local/go
 
 echo "Unpacking Go"
-tar -C /usr/local -xzf go${VERSION_GO}.linux-amd64.tar.gz
+tar -C /usr/local -xzf go${VERSION_GO}.linux-${ARCH_GO}.tar.gz
 
 echo "Deleting Go Binary Archive"
-rm -rf go${VERSION_GO}.linux-amd64.tar.gz
+rm -rf go${VERSION_GO}.linux-${ARCH_GO}.tar.gz
 
 ln -s /usr/local/go/bin/* /usr/local/bin
 
-- 
GitLab