add timeout option to portal-down script
This commit is contained in:
parent
ba7cb64d34
commit
7024b680e7
|
@ -2,6 +2,11 @@
|
||||||
|
|
||||||
set -e # exit on first error
|
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() {
|
countdown() {
|
||||||
local secs=$1
|
local secs=$1
|
||||||
while [ $secs -gt 0 ]; do
|
while [ $secs -gt 0 ]; do
|
||||||
|
@ -12,7 +17,7 @@ countdown() {
|
||||||
}
|
}
|
||||||
|
|
||||||
# stop healh-check so the server is taken our of load balancer
|
# 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
|
# then wait 5 minutes for the load balancer to propagate the dns records
|
||||||
countdown 300
|
countdown $TIMEOUT
|
||||||
|
|
Reference in New Issue