summaryrefslogtreecommitdiffstats
path: root/gpg-agent.sh
diff options
context:
space:
mode:
authorFlorian Pritz <f-p@gmx.at>2008-10-31 16:21:27 +0100
committerFlorian Pritz <f-p@gmx.at>2008-10-31 16:21:27 +0100
commit3389e2ade2688df9b4fa6ef687c6dbfb608af879 (patch)
tree28c1ed42550d3636dcf2d7fa3295b722024ac442 /gpg-agent.sh
parent283f5e991820f025cec7ce35769d2628c99c90d2 (diff)
downloadbin-3389e2ade2688df9b4fa6ef687c6dbfb608af879.tar.gz
bin-3389e2ade2688df9b4fa6ef687c6dbfb608af879.tar.xz
gpg-agent script
Diffstat (limited to 'gpg-agent.sh')
-rwxr-xr-xgpg-agent.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/gpg-agent.sh b/gpg-agent.sh
new file mode 100755
index 0000000..c497a9b
--- /dev/null
+++ b/gpg-agent.sh
@@ -0,0 +1,9 @@
+#!/bin/dash
+
+envfile="${HOME}/.gpginfo"
+
+if test -f ${envfile} && kill -0 $(cut -d: -f 2 ${envfile} | head -n 1) 2>/dev/null; then
+ eval $(cat ${envfile})
+else
+ eval `/usr/bin/gpg-agent --daemon --enable-ssh-support --write-env-file ${envfile}`
+fi