dotfiles/bin/executable_find-agent.sh

17 lines
398 B
Bash
Executable File

#!/bin/bash
#
# Add keys to ssh-agent
# TODO: make keys configurable
#
if [[ $_ = $0 ]]; then
echo "Script is a subshell, will source it: source $0"
exit 42
else
SSH_AUTH_SOCK=$(find /tmp/ -name 'agent*' -printf "%T@ %Tc %p\n" | sort -n | tail -1 | awk '{print $7}')
echo -e "$SSH_AUTH_SOCK"
export SSH_AUTH_SOCK
ssh-add ~/.ssh/daimler_rsa
ssh-add ~/.ssh/id_materna
fi