From 9b62bcb75dd3af78b8f680f8decd5beefddb46d2 Mon Sep 17 00:00:00 2001 From: David Wragg Date: Fri, 13 Mar 2015 18:17:26 +0000 Subject: [PATCH] Don't need to use sed to get the IP address part of a CIDR --- weave | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/weave b/weave index 8282f3e6..7613b3c7 100755 --- a/weave +++ b/weave @@ -353,9 +353,8 @@ tell_dns() { # get the long form of the container ID CONTAINER=$(docker inspect --format='{{.Id}}' $2 2>/dev/null) # extract IP address and routing prefix from CIDR - WEAVE_ADDR_IP=$(echo $3 | sed -e 's/\([^/]*\)\/\(.*\)/\1/') MORE_ARGS=$(docker inspect --format='--data-urlencode fqdn={{.Config.Hostname}}.{{.Config.Domainname}}.' $CONTAINER 2>/dev/null) && true - http_call $DNS_CONTAINER_NAME $DNS_HTTP_PORT $1 /name/$CONTAINER/$WEAVE_ADDR_IP $MORE_ARGS || true + http_call $DNS_CONTAINER_NAME $DNS_HTTP_PORT $1 /name/$CONTAINER/${3%/*} $MORE_ARGS || true } # Tell the newly-started weaveDNS about existing weave IPs