Skip to content

Commit 8a23dcf

Browse files
committed
mac os sync
1 parent 95565c4 commit 8a23dcf

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,16 @@ jobs:
185185
186186
echo "Attempting to connect..."
187187
set +e
188-
timeout 10s "$BIN_PATH" -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null" -o "BatchMode=yes" "$CONNECTION_STRING" echo "test" 2>&1 | tee connect_output.txt
189-
EXIT_CODE=$?
188+
if command -v timeout > /dev/null; then
189+
timeout 10s "$BIN_PATH" -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null" -o "BatchMode=yes" "$CONNECTION_STRING" echo "test" 2>&1 | tee connect_output.txt
190+
EXIT_CODE=$?
191+
else
192+
(sleep 10; kill $$ 2>/dev/null) &
193+
TIMEOUT_PID=$!
194+
"$BIN_PATH" -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null" -o "BatchMode=yes" "$CONNECTION_STRING" echo "test" 2>&1 | tee connect_output.txt
195+
EXIT_CODE=$?
196+
kill $TIMEOUT_PID 2>/dev/null || true
197+
fi
190198
set -e
191199
192200
if grep -qiE "(permission denied|password|publickey|authentication failed|Connection closed)" connect_output.txt; then

0 commit comments

Comments
 (0)