Skip to content

Commit

Permalink
Merge pull request #140 from tomwilkie/137-ip-addrs
Browse files Browse the repository at this point in the history
Don't just advertise addresses on eth devices; use blacklist on device name.
  • Loading branch information
tomwilkie committed Jun 1, 2015
2 parents 4d745ee + 3d2521d commit f673d05
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scope
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,11 @@ case "$COMMAND" in
$WEAVESCOPE_DOCKER_ARGS $SCOPE_IMAGE $WEAVESCOPE_DNS_ARGS "$@")

if dns_running; then
IP_ADDRS=$(find /sys/class/net -name eth* | xargs -n1 basename | xargs -n1 ip addr show |
grep inet | awk '{ print $2 }' | grep -oE "$IP_REGEXP" | xargs echo)
IP_ADDRS=$(hostname -I)
if [ -z "$IP_ADDRS" ]; then
echo "Could not determine local IP address; Weave DNS integration will not work correctly."
exit 1
fi
tell_dns_fqdn PUT $CONTAINER $FQDN $IP_ADDRS
fi

Expand Down

0 comments on commit f673d05

Please sign in to comment.