diff options
author | Florian Pritz <bluewind@xinu.at> | 2014-08-06 13:30:28 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2014-08-06 13:30:28 +0200 |
commit | 28c00e2d22c0288ad8eced897b4966046742d5ff (patch) | |
tree | 34652c0d4a6b8576faaa6d5cb62c4179964628ee | |
parent | 5158ffc00907e16ec86dc50e7ca9b88de84860c7 (diff) | |
download | bin-28c00e2d22c0288ad8eced897b4966046742d5ff.tar.gz bin-28c00e2d22c0288ad8eced897b4966046742d5ff.tar.xz |
gpg-agent.ssh: use standard socket (default in arch linux now)
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rwxr-xr-x | gpg-agent.sh | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/gpg-agent.sh b/gpg-agent.sh index 067d73f..801c40b 100755 --- a/gpg-agent.sh +++ b/gpg-agent.sh @@ -11,18 +11,12 @@ #---------------------------------------------------- initgpg(){ [[ -z $XDG_CONFIG_HOME ]] && XDG_CONFIG_HOME="$HOME/.config" - [[ -z $XDG_DATA_HOME ]] && XDG_DATA_HOME="$HOME/.local/share" [ -f "$XDG_CONFIG_HOME/disable-gpg-agent" ] && return 0 - envfile="${XDG_DATA_HOME}/.gpginfo" - if test -f ${envfile} && test -S $(cut -d= -f 2 ${envfile} | head -n 2 | tail -n 1) 2>/dev/null; then - . ${envfile} - else - /usr/bin/gpg-agent --daemon --enable-ssh-support --write-env-file ${envfile} - . ${envfile} + if [[ ! -S "$HOME/.gnupg/S.gpg-agent.ssh" ]]; then + pkill gpg-agent + /usr/bin/gpg-agent --daemon --enable-ssh-support --use-standard-socket >/dev/null fi - export GPG_AGENT_INFO - export SSH_AUTH_SOCK - export SSH_AGENT_PID + export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh } if [[ -n $DISPLAY ]]; then |