Skip to content

Commit

Permalink
fix HIGHEST_REVERSE_PORT detection
Browse files Browse the repository at this point in the history
  • Loading branch information
dougburks committed Dec 9, 2017
1 parent f04be5d commit d4ed5c6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions usr/sbin/sosetup-elastic
Original file line number Diff line number Diff line change
Expand Up @@ -2023,13 +2023,12 @@ EOF
echo "DOCKER_NETWORK is $DOCKER_NETWORK" >> $LOG 2>&1

# REVERSE_PORT
SSH_CMD="cat /etc/nsm/crossclustertab | cut -d: -f2 | grep '^5'"
SSH_OUTPUT=`ssh -i $KEY $SSH_USERNAME@$SERVERNAME "$SSH_CMD"`
if [ "$SSH_OUTPUT" = "" ]; then
SSH_CMD="cat /etc/nsm/crossclustertab | cut -d: -f2 | grep '^5' | sort | tail -1"
HIGHEST_REVERSE_PORT=`ssh -i $KEY $SSH_USERNAME@$SERVERNAME "$SSH_CMD"`
if [ "$HIGHEST_REVERSE_PORT" = "" ]; then
echo "Found no other sensors." >> $LOG 2>&1
REVERSE_PORT=50000
else
HIGHEST_REVERSE_PORT=$(echo $SSH_OUTPUT | sort | tail -1)
echo "HIGHEST_REVERSE_PORT is $HIGHEST_REVERSE_PORT" >> $LOG 2>&1
if [ ${HIGHEST_REVERSE_PORT} -gt 49999 ] && [ ${HIGHEST_REVERSE_PORT} -lt 59999 ]; then
let REVERSE_PORT=HIGHEST_REVERSE_PORT+1
Expand Down

0 comments on commit d4ed5c6

Please sign in to comment.