blockcheck: support cygwin native ping

This commit is contained in:
bol-van
2024-05-11 16:11:06 +03:00
parent 4e8766f245
commit 23f2de8014
2 changed files with 19 additions and 3 deletions

View File

@@ -1353,8 +1353,13 @@ pingtest()
ping -c 1 -w 1 $1 >/dev/null
;;
CYGWIN)
# cygwin does not have own PING by default. use windows PING.
ping -n 1 -w 1000 $1 >/dev/null
if starts_with "$(which ping)" /cygdrive; then
# cygwin does not have own PING by default. use windows PING.
ping -n 1 -w 1000 $1 >/dev/null
else
# they have installed cygwin ping
ping -c 1 -W 1 $1 >/dev/null
fi
;;
*)
ping -c 1 -W 1 $1 >/dev/null