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