From d2d52e170ca51d45b68481f18d567bca10b0e8bc Mon Sep 17 00:00:00 2001 From: bucde Date: Thu, 23 Sep 2021 16:41:24 +0200 Subject: [PATCH] fix: correct waiting loop --- setup | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/setup b/setup index dcc9fcd..cacf5f9 100755 --- a/setup +++ b/setup @@ -74,6 +74,14 @@ if [ $CONFIG_EXISTS == "false" ] || [ $USE_EXISTING_CONFIG == "n" ]; then echo "Config file 'config' created!" else echo "Use existing config file 'config'!" + + while read line; do + if [[ $line == *"GITEA_HOST_IP_ADDRESS="* ]]; then + GITEA_HOST_IP_ADDRESS=$(echo $line | cut -c 23-) + else if [[ $line == *"GITEA_HOST_WEB_PORT="* ]]; then + GITEA_HOST_WEB_PORT=$(echo $line | cut -c 21-) + fi + done < "config" fi cat "config" >> ".env" @@ -84,7 +92,7 @@ docker-compose up -d echo -n "Wait until gitea is ready ..." -while ! curl -fILs $GITEA_HOST_IP_ADDRESS:$GITEA_HOST_WEB_PORT ; do +while [[ "$(curl -fLs -w ''%{http_code}'' $GITEA_HOST_IP_ADDRESS:$GITEA_HOST_WEB_PORT -o /dev/null)" != "200" ]] ; do echo -n "." sleep 1 done