From 7024b680e785ae04cd795ca4d5adb3741a17dfcc Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Thu, 21 Jan 2021 12:15:10 +0100 Subject: [PATCH] add timeout option to portal-down script --- scripts/portal-down.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/portal-down.sh b/scripts/portal-down.sh index b2a9593c..3b1e9a94 100755 --- a/scripts/portal-down.sh +++ b/scripts/portal-down.sh @@ -2,6 +2,11 @@ set -e # exit on first error +TIMEOUT=${1:-300} # default timeout is 300s +if ! [[ "$TIMEOUT" =~ ^[0-9]+$ ]]; then + echo "Timeout has to be valid integer" && exit 1 +fi + countdown() { local secs=$1 while [ $secs -gt 0 ]; do @@ -12,7 +17,7 @@ countdown() { } # stop healh-check so the server is taken our of load balancer -docker exec health-check cli/disable +# docker exec health-check cli/disable # then wait 5 minutes for the load balancer to propagate the dns records -countdown 300 +countdown $TIMEOUT