diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-06 01:26:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-06 01:26:58 +0000 |
commit | 4722d4b7980d6fd8145e2e9f08492d951ea261d1 (patch) | |
tree | 7ab498b39f5bdce46b1bbc41ef5201322df4e2d4 /debian/agent-launch | |
parent | Adding upstream version 1:7.9p1. (diff) | |
download | openssh-4722d4b7980d6fd8145e2e9f08492d951ea261d1.tar.xz openssh-4722d4b7980d6fd8145e2e9f08492d951ea261d1.zip |
Adding debian version 1:7.9p1-10+deb10u2.debian/1%7.9p1-10+deb10u2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/agent-launch')
-rwxr-xr-x | debian/agent-launch | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/debian/agent-launch b/debian/agent-launch new file mode 100755 index 0000000..f3cbfae --- /dev/null +++ b/debian/agent-launch @@ -0,0 +1,23 @@ +#!/bin/sh +# helper script for launching ssh-agent, used by systemd unit +set -e + +if [ ! -d "$XDG_RUNTIME_DIR" ]; then + echo 'This needs $XDG_RUNTIME_DIR to be set' >&2 + exit 1 +fi + +if [ "$1" = start ]; then + if [ -z "$SSH_AUTH_SOCK" ] && grep -s -q '^use-ssh-agent$' /etc/X11/Xsession.options; then + S="$XDG_RUNTIME_DIR/openssh_agent" + dbus-update-activation-environment --verbose --systemd SSH_AUTH_SOCK=$S SSH_AGENT_LAUNCHER=openssh + exec ssh-agent -D -a $S + fi +elif [ "$1" = stop ]; then + if [ "$SSH_AGENT_LAUNCHER" = openssh ]; then + dbus-update-activation-environment --systemd SSH_AUTH_SOCK= + fi +else + echo "Unknown command $1" >&2 + exit 1 +fi |