From e410b3d9fe3424c598d894dfca8d8e43f3aef11a Mon Sep 17 00:00:00 2001 From: w1nst0n Date: Mon, 22 Feb 2021 20:57:20 +0000 Subject: [PATCH] Better bash version check (#60) --- debloat_script.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/debloat_script.sh b/debloat_script.sh index b541c20..5e02f46 100644 --- a/debloat_script.sh +++ b/debloat_script.sh @@ -1,7 +1,9 @@ #!/usr/bin/env bash # BASH 4.4 or newer is needed! -if (( "${BASH_VERSINFO[0]}" < 5 )); then printf "\n%s\n\n" "Please upgrade to a bash version >= 4.4" && exit 1; fi +if (( "${BASH_VERSINFO[0]}" < 4 || ("${BASH_VERSINFO[0]}" == 4 && "${BASH_VERSINFO[1]}" < 4) )); then + printf "\n%s\n\n" "Please upgrade to a bash version >= 4.4" && exit 1; +fi if ! adb get-state &>/dev/null; then printf "\n%s\n\n" "Your phone is not detected by ADB." && exit 1; fi