#!/bin/bash if ! (vault token-lookup 1>/dev/null 2>&1); then echo -n "Vault is not authenticated, trying to authenticate... " AUTH_TOKEN=$(lpass show --field=Passphrase "vault-auth") echo "${AUTH_TOKEN}" | vault auth - > /dev/null || echo "FAIL" && echo "OK" fi