diff options
author | Aaron LI <aaronly.me@outlook.com> | 2017-02-28 09:19:18 +0800 |
---|---|---|
committer | Aaron LI <aaronly.me@outlook.com> | 2017-02-28 09:19:33 +0800 |
commit | 9745c72c34f562fd422ec3d6afb9600fdf603dd3 (patch) | |
tree | d18c8a15596d2a619233eba06a77ea7212f98a59 | |
parent | 770b62c42614375e57bf658c18495784fade0698 (diff) | |
download | dotfiles-9745c72c34f562fd422ec3d6afb9600fdf603dd3.tar.bz2 |
profile: Start gpg-agent and use it for SSH
Credit: https://wiki.archlinux.org/index.php/GnuPG
-rw-r--r-- | _profile | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -86,3 +86,14 @@ export LESS="--ignore-case --raw-control-chars" if _exists dircolors; then eval $(dircolors -b) fi + +## gpg-agent: start it if not running +if ! _running gpg-agent; then + gpg-connect-agent /bye &> /dev/null +fi + +## Set SSH to use 'gpg-agent' +unset SSH_AGENT_PID +if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then + export SSH_AUTH_SOCK="/run/user/${UID}/gnupg/S.gpg-agent.ssh" +fi |