diff options
author | Aaron LI <aaronly.me@outlook.com> | 2017-01-19 19:19:24 +0800 |
---|---|---|
committer | Aaron LI <aaronly.me@outlook.com> | 2017-01-19 19:19:24 +0800 |
commit | a1815079ad4ff8076eb33bbd3f6b50e5c1a66763 (patch) | |
tree | 6bb032fb65e39e307288163f3adc64c0b2ffbcf6 /unix/gpg-agent.sh | |
parent | 582e8827ad9fe6c7843d7f4ad86337b68270996f (diff) | |
download | atoolbox-a1815079ad4ff8076eb33bbd3f6b50e5c1a66763.tar.bz2 |
Add various scripts
Diffstat (limited to 'unix/gpg-agent.sh')
-rwxr-xr-x | unix/gpg-agent.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/unix/gpg-agent.sh b/unix/gpg-agent.sh new file mode 100755 index 0000000..751c2ac --- /dev/null +++ b/unix/gpg-agent.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +# gpg-agent.sh +# autorun the gpg-agent + +envfile="${HOME}/.gnupg/gpg-agent.env" +if test -f "$envfile" && kill -0 $(grep GPG_AGENT_INFO "$envfile" | cut -d: -f 2) 2>/dev/null; then + eval "$(cat "$envfile")" +else + eval "$(gpg-agent --daemon --write-env-file "$envfile")" +fi +export GPG_AGENT_INFO # the env file does not contain the export statement + |