From db5512d6acc05340b6010dbd155c7c331770033b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Bourr=C3=A9?= Date: Sun, 13 Jan 2019 18:39:57 +0100 Subject: [PATCH] Fix waiting_to_start helper function --- scripts/_common.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index a39d88f..f477b03 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -152,19 +152,16 @@ waiting_to_start() { tail -F -n1 "$log_path" > "$templog" & # get the PID of the tail command local pid_tail=$! - local inc=0 - while ! grep --quiet "${line_match_new}" $templog && ! grep --quiet "${line_match_existing}" $templog + for i in $(seq 1 100) do - # Timeout - if [ $inc -gt 100 ] + if grep --quiet "${line_match_new}" $templog || grep --quiet "${line_match_existing}" $templog then + echo "Gitlab has correctly started." >&2 break fi - sleep 1 echo -n "." >&2 - ((inc++)) done echo "Stop Waiting"