Don't need to use sed to get the IP address part of a CIDR
This commit is contained in:
1 parent
7a8a7010e2
commit
9b62bcb75d
1 file changed
+1
-2
@@ -353,9 +353,8 @@ tell_dns() {
|
|||||||
# get the long form of the container ID
|
# get the long form of the container ID
|
||||||
CONTAINER=$(docker inspect --format='{{.Id}}' $2 2>/dev/null)
|
CONTAINER=$(docker inspect --format='{{.Id}}' $2 2>/dev/null)
|
||||||
# extract IP address and routing prefix from CIDR
|
# 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
|
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
|
# Tell the newly-started weaveDNS about existing weave IPs
|
||||||
|
|||||||
Reference in new issue
Block a user