From d855a0aa5b6167a37469e104508931e95eb2ded0 Mon Sep 17 00:00:00 2001 From: Michael Vorburger Date: Sat, 19 Oct 2024 16:35:53 +0200 Subject: [PATCH] build: Start ssh-agent if it's not already running --- container/devshell/test-ssh-agent | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/container/devshell/test-ssh-agent b/container/devshell/test-ssh-agent index b02e977..49913c8 100755 --- a/container/devshell/test-ssh-agent +++ b/container/devshell/test-ssh-agent @@ -6,6 +6,10 @@ cd "$(dirname "$0")" # currently that is not what this tests: instead it's testing SSH from where this runs into a container, with an agent. # Test that the local SSH Agent works (on the laptop/build server, where this script runs; NOT in container) +if [ -z "$SSH_AUTH_SOCK" ]; then + echo "Starting SSH Agent..." + eval "$(ssh-agent -s)" +fi ssh-add -l # TODO instead of copy/paste from ../sshd/test, share common test harness structure..