summaryrefslogtreecommitdiff
path: root/common/utils.sh
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2019-01-17 20:34:50 +0100
committerChristian Pointner <equinox@spreadspace.org>2019-01-17 20:34:50 +0100
commit161f45698e467f160206cf7fe315e750a587924e (patch)
treec8791bbe0bdce134f2eacf4855009f4830e149df /common/utils.sh
parentnextcloud app config (logo upload must be done manually, grrrr... (diff)
only activate environment if we can read the passphrase
Diffstat (limited to 'common/utils.sh')
-rw-r--r--common/utils.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/common/utils.sh b/common/utils.sh
index 3e31c568..262926c7 100644
--- a/common/utils.sh
+++ b/common/utils.sh
@@ -69,6 +69,12 @@ vault_environment__activate() {
fi
done
+ err_out=$(("gpg/get-vault-pass-$1" > /dev/null) 2>&1)
+ if [ -n "$err_out" ]; then
+ print_error "failed to activate environment: '$1' .. reading passphrase from 'gpg/get-vault-pass-$1' returned an error"
+ return 1
+ fi
+
if [ -z "${ANSIBLE_VAULT_IDENTITY_LIST}" ]; then
export ANSIBLE_VAULT_IDENTITY_LIST="$1@gpg/get-vault-pass-$1"
else