From 6c49bd3ffb016ab39bf0db24001e20514680c21d Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Wed, 22 May 2019 09:29:55 +0200 Subject: [PATCH] Fixes #24 by adding a 3 seconds wait for ping --- healthcheck.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/healthcheck.sh b/healthcheck.sh index c736d81e..4f384e84 100644 --- a/healthcheck.sh +++ b/healthcheck.sh @@ -1,9 +1,6 @@ #!/bin/sh -ping -W 1 -w 1 -q -s 8 1.1.1.1 &> /dev/null -status=$? -if [ $status = 0 ]; then - exit 0 -fi -printf "Pinging 1.1.1.1 resulted in error status code $status" +out="$(ping -W 3 -c 1 -q -s 8 1.1.1.1)" +[ $? != 0 ] || exit 0 +printf "$out" exit 1 \ No newline at end of file