]> git.pld-linux.org Git - packages/gnupg2.git/blobdiff - gnupg-agent.sh
- make it working better when no agent is running but file exists
[packages/gnupg2.git] / gnupg-agent.sh
index 89612409b14c61451acf3751172f1af01c65cd68..e0d3916fee0f65afc32b207ee0ca62bba6d76f3a 100644 (file)
@@ -12,7 +12,7 @@ if [ -r "${HOME}/.gnupg/gpg-agent.conf" ]; then
 fi
 
 if grep -q "^use-agent" ${CFG} 2>/dev/null; then
-    if [ -f "${HOME}/.gnupg/GPG_AGENT_INFO" ] && kill -0 "$(cut -d: -f2 $HOME/.gnupg/GPG_AGENT_INFO)" 2>/dev/null; then
+    if [ -f "${HOME}/.gnupg/GPG_AGENT_INFO" ] && pid="$(cut -d: -f2 $HOME/.gnupg/GPG_AGENT_INFO)" && [ -n "$pid" ] && kill -0 "$pid"  2>/dev/null; then
        export GPG_AGENT_INFO="$(cat ${HOME}/.gnupg/GPG_AGENT_INFO)"
     else
        if [ -n "$DISPLAY" -a "$X11" = "yes" ] || [ -z "$DISPLAY" -a "$X11" = "no" ]; then
This page took 0.059616 seconds and 4 git commands to generate.