Skip to content

Commit

Permalink
add check to ensure vault is unsealed before trying to get token
Browse files Browse the repository at this point in the history
  • Loading branch information
glitchcrab committed Aug 9, 2024
1 parent 3d95cc9 commit bae2956
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions hack/get-vault-token.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
#!/bin/bash

echo -e "\n[INF] checking vault status"

vault status > /dev/null 2>&1
if [ "$?" -ne 0 ]; then
echo "[ERR]: vault is not accessible"
exit
else
echo "[INF]: vault is unsealed, continuing"
fi

TOKEN=$(rbw get "Vault token")

export VAULT_TOKEN=${TOKEN}
Expand Down

0 comments on commit bae2956

Please sign in to comment.