Browse Source

[mod] utils/morty.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>
Markus Heiser 3 years ago
parent
commit
cfea51f40f
1 changed files with 12 additions and 0 deletions
  1. 12 0
      utils/morty.sh

+ 12 - 0
utils/morty.sh

@@ -283,6 +283,18 @@ install_check() {
             warn_msg "Check if public name is correct and routed or use the public IP from above."
             warn_msg "Check if public name is correct and routed or use the public IP from above."
         fi
         fi
     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() {
 remove_all() {