mirror of
https://github.com/DictXiong/dotfiles.git
synced 2024-11-24 07:37:01 +08:00
riot use get_free_port to fix issue on windows
This commit is contained in:
parent
2ffc0e38f4
commit
deec5c9b05
|
@ -168,12 +168,7 @@ run_sshl()
|
||||||
# treat as a port number
|
# treat as a port number
|
||||||
arg=localhost:$arg
|
arg=localhost:$arg
|
||||||
fi
|
fi
|
||||||
while
|
local port=$(get_free_port)
|
||||||
local port=$(shuf -n 1 -i 49152-65535)
|
|
||||||
netstat -atun | grep -q "$port"
|
|
||||||
do
|
|
||||||
continue
|
|
||||||
done
|
|
||||||
|
|
||||||
SSH_OPTIONS="$SSH_OPTIONS -NC -L $port:$arg"
|
SSH_OPTIONS="$SSH_OPTIONS -NC -L $port:$arg"
|
||||||
local cmd="$(prepare_ssh_cmd ssh)"
|
local cmd="$(prepare_ssh_cmd ssh)"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user