From d5911f7fcbe230dd12943a9debda7ab0f54df78f Mon Sep 17 00:00:00 2001 From: Mathieu Broillet Date: Fri, 16 Jun 2023 16:03:00 +0200 Subject: [PATCH] updated detection in ssh and docker scripts --- protected_resources/scripts/install-config-ssh.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/protected_resources/scripts/install-config-ssh.sh b/protected_resources/scripts/install-config-ssh.sh index ac7cc01..9ffcccf 100644 --- a/protected_resources/scripts/install-config-ssh.sh +++ b/protected_resources/scripts/install-config-ssh.sh @@ -1,10 +1,11 @@ #!/bin/bash -if which ssh >/dev/null 2>&1; then - echo "SSH is installed" - exit 1 +# check if ssh is installed +if ! command -v ssh &>/dev/null; then + echo "SSH is not installed" else - echo "SSH is not installed" + echo "SSH is already installed" + exit 1 fi if lsb_release -a 2>/dev/null | grep -q -E "Debian|Ubuntu"; then