From 8116401b7c0adc74e19af8fccdc473d2882c377b Mon Sep 17 00:00:00 2001 From: Chai Feng Date: Fri, 5 Oct 2018 18:22:22 +0800 Subject: [PATCH] fix wrong type of service_env --- ufw-docker | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ufw-docker b/ufw-docker index fae8c5b..50a50df 100755 --- a/ufw-docker +++ b/ufw-docker @@ -185,13 +185,11 @@ function ufw-docker--service-allow() { declare service_id="$(ufw-docker--get-service-id "${service_name}")" service_name="$(ufw-docker--get-service-name "${service_name}")" - declare -a service_env - exec 9< <(docker service inspect "$service_name" \ --format '{{range .Endpoint.Spec.Ports}}{{.PublishedPort}} {{.TargetPort}}/{{.Protocol}}{{"\n"}}{{end}}') while read -u 9 port target_port; do if [[ "$target_port" = "${service_port}/${service_proto}" ]]; then - service_env="ufw_public_${service_id}=${service_name}/${port}/${service_proto}" + declare service_env="ufw_public_${service_id}=${service_name}/${port}/${service_proto}" break; fi done