From 57365ba1e46ebc325d383b999ca0678482deddec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Sj=C3=B6gren?= Date: Thu, 18 Jan 2018 11:29:02 +0100 Subject: [PATCH] fail if check doesnt exist MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Sjögren --- docker-bench-security.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docker-bench-security.sh b/docker-bench-security.sh index e84cec5..5700c55 100755 --- a/docker-bench-security.sh +++ b/docker-bench-security.sh @@ -112,7 +112,12 @@ main () { if [ -z "$check" ]; then cis else - "$check" + if command -v "$check" 2>/dev/null 1>&2; then + "$check" + else + echo "Check \"$check\" doesn't seem to exist." + exit 1 + fi fi printf "\n"