diff --git a/docusaurus/docs/learn/quickstarts/network/miniziti.bash b/docusaurus/docs/learn/quickstarts/network/miniziti.bash index cfb726682..cebce7c1a 100644 --- a/docusaurus/docs/learn/quickstarts/network/miniziti.bash +++ b/docusaurus/docs/learn/quickstarts/network/miniziti.bash @@ -4,6 +4,21 @@ set -o errexit set -o nounset set -o pipefail +checkBashVersion() { + if (( "${BASH_VERSION%%.*}" < 4 )); then + echo "This script requires Bash major version 4 or greater." >&2 + echo "Detected version: $BASH_VERSION" >&2 + if [[ "$DETECTED_OS" == "macOS" ]]; then + echo -e "\nOn macOS, you can install bash with Homebrew:" >&2 + echo "brew install bash" >&2 + echo -e "\nThen run:" >&2 + #shellcheck disable=SC2016 + echo '"$(brew --prefix bash)" ./miniziti.bash ...' >&2 + fi + exit 1; + fi +} + banner(){ local profile="${1-}" @@ -334,6 +349,7 @@ main(){ DETECTED_OS="$(detectOs)" : "${DEBUG_MINIKUBE_TUNNEL:=0}" # set env = 1 to trigger the minikube tunnel probe + checkBashVersion while (( $# )); do case "$1" in