From e0da21275fc3f3ce29cbfc5d40e1afa9a1cf5539 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Fri, 1 Oct 2021 17:17:32 -0400 Subject: [PATCH] FIX: the output from which confuses an integer comparison Thanks @ldmosquera for identifying the problem and fix --- discourse-setup | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/discourse-setup b/discourse-setup index df2d5be..17678ea 100755 --- a/discourse-setup +++ b/discourse-setup @@ -124,19 +124,16 @@ check_IP_match() { ## check_docker() { - (which docker || which docker.io) 2>/dev/null - echo $? + (which docker || which docker.io) &>/dev/null } check_and_install_docker() { - found_docker=$(check_docker) - if [ "$found_docker" -ne 0 ]; then + if ! check_docker; then echo Failed to find docker or docker.io on your PATH. read -p "Enter to install Docker from https://get.docker.com/ or Ctrl+C to exit" curl https://get.docker.com/ | sh - found_docker=$(check_docker) - if [ "$found_docker" -ne 0 ]; then + if ! check_docker; then echo Still failed to find docker or docker.io on your PATH. echo Docker install failed. Quitting. exit -- 2.25.1