Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,10 @@ function store_pemkey {
chmod 400 ~/.ssh/${unique_pemkeys}.pem

cp ~/.ssh/${unique_pemkeys}.pem ${PEG_ROOT}/tmp/${cluster_name}

sshagent_pid_cnt=$(pgrep ssh-agent | wc -l)
if [ "${sshagent_pid_cnt}" -ne "0" ]; then
if [ $SSH_AGENT_PID ]; then
if ! [ $SSH_AUTH_SOCK ]; then
eval $(ssh-agent -s)
fi
ssh-add ${PEG_ROOT}/tmp/${cluster_name}/${unique_pemkeys}.pem > /dev/null 2>&1
echo "${unique_pemkeys}.pem has been added to your ssh-agent"
else
Expand Down