start-cosmic: set SSH_AUTH_SOCK only if the correct value can be determined
This commit is contained in:
parent
957fd526cb
commit
32f43be573
1 changed files with 8 additions and 2 deletions
|
|
@ -49,8 +49,14 @@ if [ -d "/run/user/$(id -u)/keyring" ]; then
|
||||||
echo "gnome-keyring-daemon not found in PATH" >&2
|
echo "gnome-keyring-daemon not found in PATH" >&2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set SSH_AUTH_SOCK to the standard gnome-keyring socket
|
# Only set SSH_AUTH_SOCK if the socket actually exists. Either
|
||||||
export SSH_AUTH_SOCK="/run/user/$(id -u)/keyring/ssh"
|
# set the correct one, or don't set one at all. Don't set the
|
||||||
|
# wrong value.
|
||||||
|
if [ -S "/run/user/$(id -u)/gcr/ssh" ]; then
|
||||||
|
export SSH_AUTH_SOCK="/run/user/$(id -u)/gcr/ssh"
|
||||||
|
elif [ -S "/run/user/$(id -u)/keyring/ssh" ]; then
|
||||||
|
export SSH_AUTH_SOCK="/run/user/$(id -u)/keyring/ssh"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if command -v systemctl >/dev/null; then
|
if command -v systemctl >/dev/null; then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue