Skip to content

Commit

Permalink
patroni-leader-check: use host -ta to check dns
Browse files Browse the repository at this point in the history
  • Loading branch information
kreatoo committed Oct 13, 2024
1 parent 269c072 commit 3b69fa5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/monocloud/patroni-leader-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ if [ "$response_code" -eq 200 ]; then
monokit alarm send --message "[patroni-leader-check] [:check:] Redis promoted to master on hostname $(hostname) with redis address $REDIS_ADDR"


current_record=$(/usr/local/bin/flarectl dns list --zone "$CF_ZONE_NAME" --type "A" | grep "$DOMAIN")
current_record=$(host -ta "$DOMAIN" | awk '{print $4}')
record_id=$(echo "$current_record" | awk '{print $1}')
current_ip=$(echo "$current_record" | awk '{for(i=1;i<=NF;i++) if($i ~ /^10\./) print $i; exit}')

Expand Down

0 comments on commit 3b69fa5

Please sign in to comment.