commit b78637c91813483f9a9b80899c4f5d9ede5c14ed parent 9aa4aee5b7a121c0af42de4bf730e8f23e8166f8 Author: pyratebeard <root@pyratebeard.net> Date: Fri, 24 Nov 2023 22:07:05 +0000 don't run if keychain is not installed Diffstat:
M | zsh/.zsh/keychain.zsh | | | 19 | +++++++++++-------- |
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/zsh/.zsh/keychain.zsh b/zsh/.zsh/keychain.zsh @@ -1,13 +1,16 @@ # KEYCHAIN -# ssh key dir -SSH_KEY_DIR="$HOME/.ssh" +## don't run if keychain not installed (i.e a server) +if command -v keychain >/dev/null ; then + # ssh key dir + SSH_KEY_DIR="$HOME/.ssh" -GPG_TTY=$(tty) -export GPG_TTY + GPG_TTY=$(tty) + export GPG_TTY -# funtoo keychain -eval $(keychain -q --agents gpg --nogui --eval 0xC7877C715113A16D) -if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ] ; then - export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" + # funtoo keychain + eval $(keychain -q --agents gpg --nogui --eval 0xC7877C715113A16D) + if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ] ; then + export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" + fi fi