From d277a187bf49fc02b49b2cdfd10207e4cc8688f7 Mon Sep 17 00:00:00 2001 From: Esa Jokinen <58781154+oh2fih@users.noreply.github.com> Date: Sun, 31 Mar 2024 10:46:01 +0300 Subject: [PATCH] Require Bash >= 4.0 The Bash on MacOS X is ancient 3.2; trying to support it will limit development of this script. --- securitytxt-signer.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/securitytxt-signer.sh b/securitytxt-signer.sh index 795e2c4..1699b06 100755 --- a/securitytxt-signer.sh +++ b/securitytxt-signer.sh @@ -52,6 +52,12 @@ required_command() { UNMET=0 +if ((BASH_VERSINFO[0] < 4)); then + echo -e "\033[0;31mThis script requires bash >= 4.0\033[0m" >&2 + echo -e "\033[0;31mYour bash ${BASH_VERSION} is unsupported.\033[0m" >&2 + ((UNMET=UNMET+1)) +fi + required_command "sed" required_command "awk" required_command "grep"