mirror of
https://github.com/openziti/ziti.git
synced 2026-10-13 15:51:21 +00:00
Add bash version check and help
This commit is contained in:
committed by
Kenneth Bingham
parent
e19286316e
commit
3bcf602364
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user