diff options
author | Luke Smith <luke@lukesmith.xyz> | 2021-08-22 09:10:54 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-22 09:10:54 -0400 |
commit | 0b9a9a3d7f2ad8394a1dd34464d14d2b4e225d68 (patch) | |
tree | 3eb4a9f71a1737a41b2ffdbed2a1133bdd0c5c8b /bin/mw | |
parent | c1bec4096930f25bdc02fd4181c65ab188ab7260 (diff) | |
parent | 8c71c10b0a8066cf0dc6bc5e0c5583eaddbb5441 (diff) |
Merge pull request #722 from pantosaur/master
password store with multiple private keys fix
Diffstat (limited to 'bin/mw')
-rwxr-xr-x | bin/mw | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -29,8 +29,7 @@ done || { echo "CA Certificate not found. Please install one or link it to /etc/ checkbasics() { command -V gpg >/dev/null 2>&1 && GPG="gpg" || GPG="gpg2" PASSWORD_STORE_DIR="${PASSWORD_STORE_DIR:-$HOME/.password-store}" - [ -r "$PASSWORD_STORE_DIR/.gpg-id" ] && - "$GPG" --list-secret-keys "$(cat "$PASSWORD_STORE_DIR/.gpg-id")" >/dev/null 2>&1 || { + [ -r "$PASSWORD_STORE_DIR/.gpg-id" ] || { echo "First run \`pass init <yourgpgemail>\` to set up a password archive." echo "(If you don't already have a GPG key pair, first run \`$GPG --full-generate-key\`.)" exit 1 ;} ;} @@ -213,7 +212,7 @@ askinfo() { \ } createpass() { echo "$password" > "$PASSWORD_STORE_DIR/$fulladdr" - "$GPG" -qer "$(cat "$PASSWORD_STORE_DIR/.gpg-id")" "$PASSWORD_STORE_DIR/$fulladdr" + "$GPG" -qe $(printf -- " -r %s" $(cat "$PASSWORD_STORE_DIR/.gpg-id")) "$PASSWORD_STORE_DIR/$fulladdr" rm -f "$PASSWORD_STORE_DIR/$fulladdr" ;} getpass() { while : ; do pass rm -f "$fulladdr" >/dev/null 2>&1 |