commit ae641176d52de334d803e64e1699cc975f4c0bd0 from: the xhr date: Tue Jul 04 09:43:16 2017 UTC Also support gpg2 commit - 005cde63388998d24173a49563f52612a3bffd67 commit + ae641176d52de334d803e64e1699cc975f4c0bd0 blob - 9bc923dcd56625e76b5f3246fd9931a21b0f11f7 blob + 9641a815779ef4bd9cfc16717e0e8c1317193bb1 --- tpm +++ tpm @@ -22,6 +22,7 @@ umask 077 ## GPG_OPTS="--quiet --yes" +GPGB="gpg" STORE_DIR="${HOME}/.password-store" TPMDIR="/tmp" NUKE="rm" @@ -56,13 +57,17 @@ abort() { mygpg() { if [ -z "$(which gpg)" ]; then - abort "gpg not found. Please install." + if [ -z "$(which gpg2)" ]; then + abort "gpg or gpg2 not found. Please install." + else + GPGB="gpg2" + fi fi if [ -n "${PASSWORD_STORE_KEY}" ]; then - gpg $GPG_OPTS --recipient "${PASSWORD_STORE_KEY}" "$@" + ${GPGB} ${GPG_OPTS} --recipient "${PASSWORD_STORE_KEY}" "$@" else - gpg $GPG_OPTS --default-recipient-self "$@" + ${GPGB} ${GPG_OPTS} --default-recipient-self "$@" fi }