diff options
author | mail_redacted_for_web | 2022-07-06 09:31:41 +0200 |
---|---|---|
committer | mail_redacted_for_web | 2022-07-06 09:31:41 +0200 |
commit | e35bf84abb7f864c7d512d2b2f84c6e204859810 (patch) | |
tree | cedddf5e4f0c289a846ae5ab7a9785b13010b7f9 /.bash/postexec.bash | |
parent | 8bf3be857b622fcbe6c49933a3ee7379b514aef1 (diff) | |
download | dotfiles-e35bf84abb7f864c7d512d2b2f84c6e204859810.tar.bz2 |
Execute key addition on any login on the hosts which serve as "admin stations"
Diffstat (limited to '.bash/postexec.bash')
-rw-r--r-- | .bash/postexec.bash | 6 |
1 files changed, 5 insertions, 1 deletions
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 |