jamf / Jamf-Environment-Test

Admin Utility for testing an environments network for success with Apple Devices
MIT License
100 stars 13 forks source link

UDP test shouldn't have -G flag set #7

Closed brianyaklin closed 1 year ago

brianyaklin commented 2 years ago

In the shell script the -G 3 TCP connection timeout flag is being set on UDP traffic:

# UDP goes direct... not proxied. 
STATUS=$(/usr/bin/nc -u -z -G 3 ${HOSTNAME} ${PORT} 2>&1 | /usr/bin/awk '{print $7}')

This results in the command failing to run:

~ % nc -u -z -G 3 time.apple.com 123
nc: TCP_CONNECTIONTIMEOUT: Invalid argument

Compared to running it without the flag:

~ % nc -u -z time.apple.com 123
Connection to time.apple.com port 123 [udp/ntp] succeeded!