commit 26868ccb05fcc7dde2724d531ac6680675f56d34 parent b93a49bc6efbc164696bab56fc1ef67c9eb6b55f Author: Sören Tempel <soeren+git@soeren-tempel.net> Date: Thu, 12 Mar 2015 14:39:40 +0100 Only read .gpg_id if PASSWORD_STORE_KEY isn't set already Diffstat:
M | tpm | | | 8 | ++++---- |
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tpm b/tpm @@ -23,14 +23,14 @@ umask 077 GPG_OPTS="--quiet --yes --batch" STORE_DIR="${PASSWORD_STORE_DIR:-${HOME}/.password-store}" -if [ -r "${STORE_DIR}/.gpg-id" ]; then +if [ -r "${STORE_DIR}/.gpg-id" ] && [ -z "${PASSWORD_STORE_KEY}" ]; then read -r PASSWORD_STORE_KEY < "${STORE_DIR}/.gpg-id" fi -if [ -z "${PASSWORD_STORE_KEY}" ]; then - GPG_OPTS="${GPG_OPTS} --default-recipient-self" -else +if [ -n "${PASSWORD_STORE_KEY}" ]; then GPG_OPTS="${GPG_OPTS} --recipient '${PASSWORD_STORE_KEY}'" +else + GPG_OPTS="${GPG_OPTS} --default-recipient-self" fi ##