@@ -55,9 +55,7 @@ usage() {
55
55
log " "
56
56
log " -v|--verbose verbose mode"
57
57
log " "
58
- log " -c|--no-com-test Continue running regardless failed communication test."
59
- log " Use with start and foreground commands when ssh agent"
60
- log " is not running or ready yet."
58
+ log " -s|--skip-test skip ssh-agent communication test"
61
59
log " "
62
60
log " COMMAND: start, stop, foreground"
63
61
}
@@ -77,16 +75,16 @@ main() {
77
75
78
76
POSITIONAL=()
79
77
VERBOSE=" "
80
- NO_COM_TEST =" "
78
+ SKIP_SSH_TEST =" "
81
79
while (( $# > 0 )) ; do
82
80
case " $1 " in
83
81
-v | --verbose)
84
82
VERBOSE=" ENABLED"
85
83
shift # shift once since flags have no values
86
84
;;
87
85
88
- -c | --no-com -test)
89
- NO_COM_TEST =" TRUE"
86
+ -s | --skip -test)
87
+ SKIP_SSH_TEST =" TRUE"
90
88
shift
91
89
;;
92
90
@@ -168,21 +166,13 @@ relay() {
168
166
fi
169
167
log " Relay is running with PID: ${SOCAT_WSL_AGENT_SSH_PID} "
170
168
171
- log -n " Polling remote ssh-agent..."
172
- SSH_AUTH_SOCK=" ${WSL_AGENT_SSH_SOCK} " ssh-add -L > /dev/null 2>&1
173
- status=$?
174
- if [[ " $status " != 0 ]]; then
175
- log " [$status ] Failure communicating with ssh-agent"
176
- if [[ -n " $NO_COM_TEST " ]]; then
177
- log " Continuing despite the failed communication test."
178
- else
179
- die
180
- fi
181
- else
169
+ if [[ -z " $SKIP_SSH_TEST " ]]; then
170
+ log -n " Polling remote ssh-agent..."
171
+ SSH_AUTH_SOCK=" ${WSL_AGENT_SSH_SOCK} " ssh-add -L > /dev/null 2>&1 || die " [$? ] Failure communicating with ssh-agent"
182
172
log " OK"
183
173
fi
184
174
185
- # Everything checks, we are ready for actions
175
+ # Everything necessary checks, we are ready for actions
186
176
log " Entering wait..."
187
177
wait ${SOCAT_WSL_AGENT_SSH_PID}
188
178
}
0 commit comments