zshrc: Improve finding GnuPG SSH socket
This commit is contained in:
parent
15237c7da7
commit
29d698b390
1 changed files with 3 additions and 10 deletions
13
zshrc
13
zshrc
|
@ -369,16 +369,9 @@ if __has_command gpg gpg2; then
|
||||||
# Make sure GPG agent is running.
|
# Make sure GPG agent is running.
|
||||||
gpg --card-status &>/dev/null
|
gpg --card-status &>/dev/null
|
||||||
|
|
||||||
local sock
|
alias gssh='SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) ssh -o IdentitiesOnly=no'
|
||||||
if [ -d "$XDG_RUNTIME_DIR/gnupg" ]; then
|
alias gssh-add='SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) ssh-add'
|
||||||
sock=$(find "$XDG_RUNTIME_DIR/gnupg" -name S.gpg-agent.ssh |
|
alias gsftp='SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) sftp -o IdentitiesOnly=no'
|
||||||
head -1)
|
|
||||||
fi
|
|
||||||
[ -n "$sock" ] || sock="$GNUPGHOME/S.gpg-agent.ssh"
|
|
||||||
|
|
||||||
alias gssh="SSH_AUTH_SOCK=$sock ssh -o IdentitiesOnly=no"
|
|
||||||
alias gssh-add="SSH_AUTH_SOCK=$sock ssh-add"
|
|
||||||
alias gsftp="SSH_AUTH_SOCK=$sock sftp -o IdentitiesOnly=no"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if __has_command cryptopassphrase; then
|
if __has_command cryptopassphrase; then
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue