riot use get_free_port to fix issue on windows

This commit is contained in:
Dict Xiong 2023-08-17 18:05:51 +08:00
parent 2ffc0e38f4
commit deec5c9b05

View File

@ -168,12 +168,7 @@ run_sshl()
# treat as a port number
arg=localhost:$arg
fi
while
local port=$(shuf -n 1 -i 49152-65535)
netstat -atun | grep -q "$port"
do
continue
done
local port=$(get_free_port)
SSH_OPTIONS="$SSH_OPTIONS -NC -L $port:$arg"
local cmd="$(prepare_ssh_cmd ssh)"