File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,24 @@ function setClusterInfo() {
77
77
78
78
# Verify ssh prereqs
79
79
function verify-prereqs {
80
- # Expect at least one identity to be available.
80
+ local rc
81
+
82
+ rc=0
83
+ ssh-add -L 1> /dev/null 2> /dev/null || rc=" $? "
84
+ # "Could not open a connection to your authentication agent."
85
+ if [[ " ${rc} " -eq 2 ]]; then
86
+ eval " $( ssh-agent) " > /dev/null
87
+ trap-add " kill ${SSH_AGENT_PID} " EXIT
88
+ fi
89
+
90
+ rc=0
91
+ ssh-add -L 1> /dev/null 2> /dev/null || rc=" $? "
92
+ # "The agent has no identities."
93
+ if [[ " ${rc} " -eq 1 ]]; then
94
+ # Try adding one of the default identities, with or without passphrase.
95
+ ssh-add || true
96
+ fi
97
+ # Expect at least one identity to be available.
81
98
if ! ssh-add -L 1> /dev/null 2> /dev/null; then
82
99
echo " Could not find or add an SSH identity."
83
100
echo " Please start ssh-agent, add your identity, and retry."
You can’t perform that action at this time.
0 commit comments