summaryrefslogtreecommitdiff
path: root/utils/filtron.sh
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2021-10-29 17:26:58 +0200
committerMarkus Heiser <markus.heiser@darmarIT.de>2021-10-29 15:51:30 +0000
commitd8d6c3d4ee5efa69fe3c703309e4e72c8e25d9da (patch)
tree90d204d7d55633a336144b2cb62d21f60282dbc5 /utils/filtron.sh
parent064b545f1426e04f5a3ad3e354b6c68118a15d8f (diff)
downloadsearxng-d8d6c3d4ee5efa69fe3c703309e4e72c8e25d9da.tar.gz
searxng-d8d6c3d4ee5efa69fe3c703309e4e72c8e25d9da.zip
[mod] utils/filtron.sh - check golang version is go1.17.2
Related-to: 5c4afdd7 https://github.com/searxng/searxng/issues/455 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'utils/filtron.sh')
-rwxr-xr-xutils/filtron.sh14
1 files changed, 13 insertions, 1 deletions
diff --git a/utils/filtron.sh b/utils/filtron.sh
index 35bd10745..eb34b2413 100755
--- a/utils/filtron.sh
+++ b/utils/filtron.sh
@@ -42,7 +42,8 @@ SERVICE_GROUP="${SERVICE_USER}"
SERVICE_GROUP="${SERVICE_USER}"
GO_ENV="${SERVICE_HOME}/.go_env"
-GO_PKG_URL="https://golang.org/dl/go1.17.2.linux-amd64.tar.gz"
+GO_VERSION="go1.17.2"
+GO_PKG_URL="https://golang.org/dl/${GO_VERSION}.linux-amd64.tar.gz"
GO_TAR=$(basename "$GO_PKG_URL")
APACHE_FILTRON_SITE="searx.conf"
@@ -268,6 +269,17 @@ install_check() {
fi
fi
+ if [[ "${GO_VERSION}" > "$(go_version)" ]]; then
+ warn_msg "golang ($(go_version)) needs to be $GO_VERSION at least"
+ else
+ info_msg "golang $(go_version) is installed (min needed is: $GO_VERSION)"
+ fi
+}
+
+go_version(){
+ sudo -i -u "$SERVICE_USER" <<EOF
+go version | cut -d' ' -f 3
+EOF
}
remove_all() {