neodotfiles/config/runit/sv/ssh-agent
2024-11-02 07:02:51 -04:00

20 lines
489 B
Bash
Executable file

#!/usr/bin/env bash
#
# Start ssh-agent from runit
#
# Author: Dave Eddy <dave@daveeddy.com>
# Date: August 29, 2018
# License: MIT
file=~/.ssh/ssh-agent-env
exec > "$file"
echo "# started $(date)"
# For some reason, this line doesn't get emitted by ssh-agent when it is run
# with -d or -D. Since we are starting the program with exec we already know
# the pid ahead of time though so we can create this line manually
echo "SSH_AGENT_PID=$$; export SSH_AGENT_PID"
exec ssh-agent -D