Skip to content

Commit

Permalink
Don't just advertise addresses on eth devices; use blacklist on devic…
Browse files Browse the repository at this point in the history
…e name.
  • Loading branch information
Tom Wilkie committed Jun 1, 2015
1 parent 2e8df4a commit a61c2aa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scope
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,12 @@ 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 |
DEVICES=$(find /sys/class/net -type l | grep -vE "docker|veth|lo")
if [ -z "$DEVICES" ]; then
echo "Could not determine local IP address; Weave DNS integration will not work correctly."
exit 1
fi
IP_ADDRS=$(echo "$DEVICES" | xargs -n1 basename | xargs -n1 ip addr show |
grep inet | awk '{ print $2 }' | grep -oE "$IP_REGEXP" | xargs echo)
tell_dns_fqdn PUT $CONTAINER $FQDN $IP_ADDRS
fi
Expand Down

0 comments on commit a61c2aa

Please # to comment.