forked from finallycoffee/base
feat(gnupg): add role for configuring gnupg with support to act as an ssh agent
This commit is contained in:
13
roles/gnupg/files/gpg-configure-ssh-auth-socket.sh
Normal file
13
roles/gnupg/files/gpg-configure-ssh-auth-socket.sh
Normal file
@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
rc=$(pgrep gpg-agent)
|
||||
if [ "$rc" != 0 ]; then
|
||||
export GPG_AGENT_INFO
|
||||
export SSH_AUTH_SOCK
|
||||
export SSH_AGENT_PID
|
||||
else
|
||||
eval $(gpg-agent --daemon)
|
||||
fi
|
||||
|
||||
gpg-connect-agent /bye
|
||||
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
|
Reference in New Issue
Block a user