diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2013-01-13 15:37:49 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2013-01-13 15:37:49 -0200 |
commit | 454c6e3c77b3db507ee81875219089047fc2d5a3 (patch) | |
tree | 34ea351902ddd6094bc0a96a65b4bc07e9ee83d8 /gpg-agent-eval | |
download | scripts-454c6e3c77b3db507ee81875219089047fc2d5a3.tar.gz scripts-454c6e3c77b3db507ee81875219089047fc2d5a3.tar.bz2 |
Initial import
Diffstat (limited to 'gpg-agent-eval')
-rwxr-xr-x | gpg-agent-eval | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gpg-agent-eval b/gpg-agent-eval new file mode 100755 index 0000000..6fa169a --- /dev/null +++ b/gpg-agent-eval @@ -0,0 +1,19 @@ +#!/bin/bash +# +# Initialize the gpg-agent. +# + +# GPG Agent +GPG_TTY=`tty` +export GPG_TTY + +function gpg_agent_eval_run { + if test -f $HOME/.gpg-agent-info && \ + kill -0 `cut -d: -f 2 $HOME/.gpg-agent-info` 2>/dev/null; then + GPG_AGENT_INFO=`cat $HOME/.gpg-agent-info` export GPG_AGENT_INFO + else + eval `gpg-agent --daemon` echo $GPG_AGENT_INFO >$HOME/.gpg-agent-info + fi +} + +gpg_agent_eval_run |