From: Mark Wooding Date: Sun, 27 Jun 2010 22:19:29 +0000 (+0100) Subject: dot/bash_profile: Different strategy for finding gnome-keyring-daemon. X-Git-Url: https://git.distorted.org.uk/~mdw/profile/commitdiff_plain/f589321e4c701e5f80643e163b49a0c34e8bfc5f dot/bash_profile: Different strategy for finding gnome-keyring-daemon. If its environment variables exist and its socket is in the right place, or we have a session bus and the keyring daemon is listening on it, then start it up. --- diff --git a/dot/bash_profile b/dot/bash_profile index 24427bd..12f5f52 100644 --- a/dot/bash_profile +++ b/dot/bash_profile @@ -198,14 +198,16 @@ ulimit -S -c 0 # --- Start an ssh authentication agent --- -if [ "$DBUS_SESSION_BUS_ADDRESS" ] && - dbus-send --session --print-reply --dest=org.freedesktop.DBus \ - / org.freedesktop.DBus.GetNameOwner string:org.gnome.keyring \ - >/dev/null 2>/dev/null && - stuff=$(gnome-keyring-daemon -s 2>/dev/null) +if { { [ "$GNOME_KEYRING_CONTROL" ] && + [ -s "$GNOME_KEYRING_CONTROL" ]; } || + { [ "$DBUS_SESSION_BUS_ADDRESS" ] && + dbus-send --session --print-reply --dest=org.freedesktop.DBus \ + / org.freedesktop.DBus.GetNameOwner string:org.gnome.keyring \ + >/dev/null 2>/dev/null; }; } && + stuff=$(gnome-keyring-daemon -s -c ssh 2>/dev/null) then eval "$stuff" - export GNOME_KEYRING_CONTROL SSH_AUTH_SOCK + export SSH_AUTH_SOCK fi eval `start-ssh-agent -b`