diff --git a/bin/executable_find-agent.sh b/bin/executable_find-agent.sh index 6156fa8..fc35065 100755 --- a/bin/executable_find-agent.sh +++ b/bin/executable_find-agent.sh @@ -4,9 +4,13 @@ # TODO: make keys configurable # -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 - +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 diff --git a/dot_bashrc.d/executable_08.alias b/dot_bashrc.d/executable_08.alias index b52d18b..bd41652 100644 --- a/dot_bashrc.d/executable_08.alias +++ b/dot_bashrc.d/executable_08.alias @@ -28,3 +28,8 @@ alias tailer="tail --follow=name --retry" # git aliases 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'