Skip to content

Commit

Permalink
Make sure that the address isn't empty.
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-barry committed Jun 21, 2024
1 parent 466eced commit 424d7eb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ resolve_domain_to_ipv4() {

# If there are multiple addresses returned, the first address is selected
ip=$(dig +short A "$domain" | head -n 1)
if [[ -z "$ip" ]]; then
echo ""
if [[ -n "$ip" ]]; then
echo "$ip"
fi

echo "$ip"
echo ""
}

# Function to resolve domain to IPv6
Expand All @@ -23,11 +23,11 @@ resolve_domain_to_ipv6() {

# If there are multiple addresses returned, the first address is selected
ip=$(dig +short AAAA "$domain" | head -n 1)
if [[ -z "$ip" ]]; then
echo ""
if [[ -n "$ip" ]]; then
echo "[$ip]"
fi

echo "[$ip]"
echo ""
}

TO_IPV4_ADDR=""
Expand Down

0 comments on commit 424d7eb

Please sign in to comment.