Skip to content

Commit

Permalink
Update Consent_request.sh
Browse files Browse the repository at this point in the history
Signed-off-by: Josef Edwards <joed6834@colorado.edu>
  • Loading branch information
bearycool11 authored Nov 23, 2024
1 parent 3f5b2f5 commit 59a236d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Consent_request.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ resolve_and_send_request() {
local LOG_FILE="$2"
local TIMESTAMP=$(date '+%Y-%m-%d %H:%M:%S')

# Resolve the IP address using dig
local IP=$(dig +short "$URL" | tail -n1)
# Resolve the IP address using host
local IP=$(host "$URL" | awk '/has address/ { print $4 }' | head -n1)
if [ -z "$IP" ]; then
echo "[$TIMESTAMP] ERROR: Failed to resolve $URL" >> "$ERROR_LOG_FILE"
echo "[$TIMESTAMP] ERROR: Failed to resolve $URL using host" >> "$ERROR_LOG_FILE"
return 1
fi

Expand Down

0 comments on commit 59a236d

Please sign in to comment.