Merge pull request #827 from kay0u/patch-2

[FIX] find udp port
This commit is contained in:
Alexandre Aubin 2019-11-08 23:06:12 +01:00 committed by GitHub
commit 33fdfa690e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,7 +17,7 @@ ynh_find_port () {
ynh_handle_getopts_args "$@"
test -n "$port" || ynh_die --message="The argument of ynh_find_port must be a valid port."
while netcat -z 127.0.0.1 $port # Check if the port is free
while ss -nltu | grep -q -w :$port # Check if the port is free
do
port=$((port+1)) # Else, pass to next port
done