neodotfiles/config/runit/sv/ssh-agent

21 lines
489 B
Text
Raw Normal View History

2024-11-02 11:02:51 +00:00
#!/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