Added check if find-agent is sourced and aliases to own scripts.

This commit is contained in:
Stefan Gaiselmann 2021-01-28 12:56:59 +01:00
parent 074d8f189a
commit e025a0cc72
2 changed files with 15 additions and 6 deletions

View File

@ -4,9 +4,13 @@
# TODO: make keys configurable # 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}') SSH_AUTH_SOCK=$(find /tmp/ -name 'agent*' -printf "%T@ %Tc %p\n" | sort -n | tail -1 | awk '{print $7}')
echo -e "$SSH_AUTH_SOCK" echo -e "$SSH_AUTH_SOCK"
export SSH_AUTH_SOCK export SSH_AUTH_SOCK
ssh-add ~/.ssh/daimler_rsa ssh-add ~/.ssh/daimler_rsa
ssh-add ~/.ssh/id_materna ssh-add ~/.ssh/id_materna
fi

View File

@ -28,3 +28,8 @@ alias tailer="tail --follow=name --retry"
# git aliases # git aliases
alias gg='git graph' alias gg='git graph'
# aliases to own scripts
alias start-agent='start-agent.sh'
alias find-agent='find-agent.sh'
alias findAgent='find-agent.sh'