mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-22 07:01:09 +02:00
31 lines
515 B
Bash
31 lines
515 B
Bash
#!/usr/bin/env bash
|
|
# Copyright (c) HashiCorp, Inc.
|
|
# SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
|
binpath=${VAULT_INSTALL_DIR}/vault
|
|
|
|
function fail() {
|
|
echo "$1" 1>&2
|
|
exit 1
|
|
}
|
|
|
|
count=0
|
|
retries=5
|
|
while :; do
|
|
# Check the Vault seal status
|
|
seal_status=$($binpath status -format json | jq '.sealed')
|
|
|
|
if [[ "$seal_status" == "true" ]]; then
|
|
exit 0
|
|
fi
|
|
|
|
wait=$((3 ** count))
|
|
count=$((count + 1))
|
|
if [ "$count" -lt "$retries" ]; then
|
|
sleep "$wait"
|
|
else
|
|
fail "Expected node to be sealed"
|
|
fi
|
|
done
|