18 lines
329 B
Bash
Executable File
18 lines
329 B
Bash
Executable File
#!/bin/bash
|
|
# wait until wsl environment is ready
|
|
APP_DIR="$(dirname "$0")"
|
|
WSL_INTEROP_READY="$APP_DIR/wsl-interop-ready"
|
|
INTERVAL=0.5
|
|
|
|
TIMEOUT=$1
|
|
SECONDS=0
|
|
|
|
until $WSL_INTEROP_READY; do
|
|
if [ "$TIMEOUT" ] && (( SECONDS >= "$TIMEOUT" )); then
|
|
echo "Timeout waiting for WSL socket dir" >&2
|
|
exit 1
|
|
fi
|
|
|
|
sleep $INTERVAL
|
|
done
|