From 9dcae25e1aa627347fccab133617412628f07d7c Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 21 Sep 2012 17:23:08 +0200 Subject: Add support for PASSWORD_STORE_KEY env var. --- man/pass.1 | 4 +++- src/password-store.sh | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/man/pass.1 b/man/pass.1 index 67dcca6..d00363b 100644 --- a/man/pass.1 +++ b/man/pass.1 @@ -42,7 +42,9 @@ extended description using \fBinit\fP and .BR git (1). The \fBinit\fP command must be run before other commands in order to initialize -the password store with the correct gpg key id. +the password store with the correct gpg key id. Passwords are encrypting using +the gpg key set with \fBinit\fP, unless the \fBPASSWORD_STORE_KEY\fP environment +variable is set to an alternative key id. There is a corresponding bash completion script for use with tab completing password names in diff --git a/src/password-store.sh b/src/password-store.sh index f137f55..21f8fe4 100755 --- a/src/password-store.sh +++ b/src/password-store.sh @@ -175,7 +175,9 @@ case "$command" in ;; esac -if ! [[ -f $ID ]]; then +if [[ -n $PASSWORD_STORE_KEY ]]; then + ID="$PASSWORD_STORE_KEY" +elif ! [[ -f $ID ]]; then echo "You must run:" echo " $program init your-gpg-id" echo "before you may use the password store." -- cgit v1.2.3