Add dns_domain helper to weave script
This commit is contained in:
1 parent
a1007411ad
commit
9fddad02ad
1 file changed
+13
@@ -660,6 +660,16 @@ dns_args() {
|
||||
DNS_ARGS="$DNS_ARG $DNS_SEARCH_ARG"
|
||||
}
|
||||
|
||||
# Use the weaveDNS REST API to determine the local domain. If weaveDNS is not
|
||||
# running, return the default value ('weave.local.')
|
||||
dns_domain() {
|
||||
if DOMAIN=$(http_call $DNS_CONTAINER_NAME $DNS_HTTP_PORT GET /domain 2>/dev/null) ; then
|
||||
echo $DOMAIN
|
||||
else
|
||||
echo 'weave.local.'
|
||||
fi
|
||||
}
|
||||
|
||||
# Print an error to stderr and return with an indicative exit status
|
||||
# if the container $1 does not exist or isn't running.
|
||||
check_running() {
|
||||
@@ -1069,6 +1079,9 @@ case "$COMMAND" in
|
||||
dns_args "$@"
|
||||
echo -n $DNS_ARGS
|
||||
;;
|
||||
dns-domain)
|
||||
echo $(dns_domain)
|
||||
;;
|
||||
docker-bridge-ip)
|
||||
docker_bridge_ip
|
||||
echo -n $DOCKER_BRIDGE_IP
|
||||
|
||||
Reference in new issue
Block a user