Add gpg convenience script.
This commit is contained in:
parent
63c5cb05bc
commit
b6f56ab7af
14
bash/gpg-up.sh
Normal file
14
bash/gpg-up.sh
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
# This function ensures gpg commands will work properly, in the current shell. I have found it needful on
|
||||||
|
# OS X when using a smartcard and gpg-agent for ssh auth, in particular.
|
||||||
|
function gpg-up() {
|
||||||
|
while [[ $(ps axu | grep gpg-agent | grep -v grep | wc -l | tr -d ' ') -ne '0' ]]; do
|
||||||
|
pkill gpg-agent
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
|
||||||
|
gpg-agent --daemon
|
||||||
|
. ~/.gpg-agent-info
|
||||||
|
GPG_TTY=$(tty)
|
||||||
|
|
||||||
|
export GPG_TTY GPG_AGENT_INFO SSH_AUTH_SOCK SSH_AGENT_PID
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user