From e35bf84abb7f864c7d512d2b2f84c6e204859810 Mon Sep 17 00:00:00 2001 From: Harald Pfeiffer Date: Wed, 6 Jul 2022 09:31:41 +0200 Subject: Execute key addition on any login on the hosts which serve as "admin stations" --- .bash/postexec.bash | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.bash/postexec.bash b/.bash/postexec.bash index b2f257e..564356a 100644 --- a/.bash/postexec.bash +++ b/.bash/postexec.bash @@ -1,4 +1,8 @@ declare -x SSH_AUTH_SOCK SSH_AGENT_PID if [ -n "$SSHENVFILE" ] && [ -r "$SSHENVFILE" ];then - source "$SSHENVFILE" + if source "$SSHENVFILE"; then + if echo "${SSHAGH[@]}"|tr ' ' '\n'|grep -P "^$(hostname -f)$" > /dev/null;then + add-sshagent-init + fi + fi fi -- cgit v1.2.3