From deec5c9b0509e35feffcbf4616ad810425bb7792 Mon Sep 17 00:00:00 2001 From: Dict Xiong Date: Thu, 17 Aug 2023 18:05:51 +0800 Subject: [PATCH] riot use get_free_port to fix issue on windows --- scripts/riot | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/scripts/riot b/scripts/riot index 4137fa8..376c63d 100755 --- a/scripts/riot +++ b/scripts/riot @@ -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)"