Updated, added ssh-agent runit service

This commit is contained in:
Lian Drake 2024-10-24 01:37:21 -04:00
parent e6c6ed2ddd
commit 684d1f3b66
2 changed files with 20 additions and 0 deletions

View file

20
config/runit/sv/ssh-agent Executable file
View file

@ -0,0 +1,20 @@
#!/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