Skip to content

Commit

Permalink
fix: 🐛 nc command error
Browse files Browse the repository at this point in the history
  • Loading branch information
monlor committed Jul 24, 2024
1 parent d269c8b commit dc3201e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ws-scrcpy/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh

ADB_ADDRESS=redroid-1:5555

TIMEOUT=${TIMEOUT:-60}

if [ -n "${ADB_ADDRESS:-}" ]; then
Expand All @@ -8,7 +10,7 @@ if [ -n "${ADB_ADDRESS:-}" ]; then
host=$(echo ${address} | cut -d':' -f1)
port=$(echo ${address} | cut -d':' -f2)
start=0
while ! nc -z "${host}" "${port}" &> /dev/null; do
while ! nc -w 1 -z "${host}" "${port}"; do
echo "Failed to connect to ${address}, retry after 1s ..."
sleep 1
start=$((start+1))
Expand Down

0 comments on commit dc3201e

Please sign in to comment.