mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-24 15:11:19 +02:00
Fix duplicate sever-port bug
cros_copy_upgrade_server had a bug where it would always start servers on port 8081 regrdless of whether that port was free. This was a bug in the "get next free port" code. BUG=chromium-os:4776 TEST=Reran multiple instances at once, run netstat -nlt Review URL: http://codereview.chromium.org/2975006
This commit is contained in:
parent
8ae113bb42
commit
bd2871a43a
@ -118,7 +118,7 @@ start_server () {
|
||||
# Find a TCP listen socket that is not in use
|
||||
ssh ${FLAGS_upgrade_server} "netstat -lnt" | awk '{ print $4 }' > $portlist
|
||||
server_port=8081
|
||||
while grep -q ":${port}$" $portlist; do
|
||||
while grep -q ":${server_port}$" $portlist; do
|
||||
server_port=$[server_port + 1]
|
||||
done
|
||||
rm -f $portlist
|
||||
|
Loading…
x
Reference in New Issue
Block a user