Skip to content

Commit

Permalink
Check if host actually points to localhost
Browse files Browse the repository at this point in the history
  • Loading branch information
back-2-95 committed Aug 25, 2022
1 parent 18c5ac7 commit d3ba032
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions traefik/add-service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ FILENAME="/configuration/$HOST.yml"
ROUTER="$HOST_DASHED-router"
SERVICE="$HOST_DASHED-service"
CERT="/ssl/$DOMAIN"
RESOLVED_IP=$(dig +short $HOST | tail -n1)

if [ "$RESOLVED_IP" != "127.0.0.1" ]; then
printf "Error: Host $HOST does not point to localhost (127.0.0.1)!"
exit 1
fi

printf "Creating configuration for local service: https://$HOST --> localhost:$PORT\n\n"

Expand Down

0 comments on commit d3ba032

Please sign in to comment.