Do not crash on no token

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2018-05-30 14:38:19 +02:00
parent 2632df1559
commit e8c6007647
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -32,6 +32,11 @@ function main() {
export VAULT_TOKEN=$(authenticate)
UNSEAL_TOKEN=$(getUnsealKey || echo "")
[ -z "${UNSEAL_TOKEN}"] && {
echo "No unseal token found, waiting..."
return 0
}
unseal "${UNSEAL_TOKEN}"
isSealed && {
@ -47,5 +52,5 @@ function unseal() {
while [ 1 ]; do
main
sleep 10
sleep 10
done