From b15c46119a7a2851c29a7e687d71eafb9fb8750a Mon Sep 17 00:00:00 2001 From: Tobias Gesellchen Date: Mon, 9 Jan 2023 09:13:04 +0100 Subject: [PATCH] fix: `wget` in alpine runs into an endless retry loop (#100) --- wait-for | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wait-for b/wait-for index 21d5701..eb6265f 100755 --- a/wait-for +++ b/wait-for @@ -68,11 +68,11 @@ wait_for() { while :; do case "$PROTOCOL" in - tcp) + tcp) nc -w 1 -z "$HOST" "$PORT" > /dev/null 2>&1 ;; http) - wget --timeout=1 -q "$HOST" -O /dev/null > /dev/null 2>&1 + wget --timeout=1 --tries=1 -q "$HOST" -O /dev/null > /dev/null 2>&1 ;; *) echoerr "Unknown protocol '$PROTOCOL'" @@ -81,7 +81,7 @@ wait_for() { esac result=$? - + if [ $result -eq 0 ] ; then if [ $# -gt 7 ] ; then for result in $(seq $(($# - 7))); do