Skip to content

Commit

Permalink
Adding support for srv records
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbyt3r committed May 17, 2023
1 parent 46044c7 commit d205843
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions uber-wrapper.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
#!/bin/bash
set -e

# SESSION_HOST and BROKER_HOST may point to SRV records that need to get resolved to a host/port
SESSION_REC=$(dig srv +noall +answer +short "$SESSION_HOST" | cut -d ' ' -f 3,4 | head -1)
BROKER_REC=$(dig srv +noall +answer +short "$BROKER_HOST" | cut -d ' ' -f 3,4 | head -1)
if [[ ! -z "$SESSION_REC" ]]; then
SESSION_HOST=$(echo $SESSION_REC | cut -d ' ' -f 2)
SESSION_PORT=$(echo $SESSION_REC | cut -d ' ' -f 1)
fi
if [[ ! -z "$BROKER_REC" ]]; then
BROKER_HOST=$(echo $BROKER_REC | cut -d ' ' -f 2)
BROKER_PORT=$(echo $BROKER_REC | cut -d ' ' -f 1)
fi

# This will replace any variable references in these files
# If you want to add any additional settings here just add
# the variables to the environment when running this.
Expand Down

0 comments on commit d205843

Please sign in to comment.