diff --git a/services/vault/scripts/vault_k8s_auth_configure.sh b/services/vault/scripts/vault_k8s_auth_configure.sh index 9e2f674..4457fc6 100644 --- a/services/vault/scripts/vault_k8s_auth_configure.sh +++ b/services/vault/scripts/vault_k8s_auth_configure.sh @@ -4,17 +4,17 @@ set -eu log() { echo "[vault-k8s-auth] $*"; } status_json="$(vault status -format=json || true)" -if [[ -z "${status_json}" ]]; then +if [ -z "${status_json}" ]; then log "vault status failed; check VAULT_ADDR and VAULT_TOKEN" exit 1 fi -if ! grep -q '"initialized":true' <<<"${status_json}"; then +if ! printf '%s' "${status_json}" | grep -q '"initialized":true'; then log "vault not initialized; skipping" exit 0 fi -if grep -q '"sealed":true' <<<"${status_json}"; then +if printf '%s' "${status_json}" | grep -q '"sealed":true'; then log "vault sealed; skipping" exit 0 fi