add new functions for ssh-agents

This commit is contained in:
Jakobus Schürz 2020-09-21 13:00:56 +02:00
parent eb41e28b25
commit ab3884025f
2 changed files with 13 additions and 2 deletions

View file

@ -1,5 +1,7 @@
#!/bin/bash
[ -n "${SSH_AGENTS_DIR+x} ] && { AGENTS_DIR=${HOME}/.ssh/agents; export AGENTS_DIR; }
[ -n "${SSH_AGENT_SOCKETS_DIR+x} ] && { AGENTS_DIR=${HOME}/.ssh/agents; export AGENTS_DIR; }
agent-start-or-restart () {
local ssh_identity
@ -8,8 +10,8 @@ agent-start-or-restart () {
if [ -n "${1+x}" ]; then
ssh_identity="$1"
agentfile="${HOME}/.ssh/agents/agent-${ssh_identity}-$(hostname)"
agentsocket="${HOME}/.ssh/agents/socket-${ssh_identity}-$(hostname)"
agentfile="${SSH_AGENTS_DIR}/agent-${ssh_identity}-$(hostname)"
agentsocket="${SSH_AGENTS_SOCKETS_DIR}/socket-${ssh_identity}-$(hostname)"
echo ssh-identität: $ssh_identity >&2
if [ -e $agentsocket ]; then

View file

@ -932,3 +932,12 @@ agent-start-or-restart () {
}
createdirs () {
for i in $@;do
echo mkdir -p "$i"
done
}