find all service ufw-docker-agent labels
This commit is contained in:
parent
424c2b4474
commit
1c87b364f4
@ -6,6 +6,13 @@ ufw_docker_agent_image=192.168.56.120:5000/ufw-docker-agent
|
|||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
|
docker service inspect "$ufw_docker_agent" \
|
||||||
|
--format '{{range $k,$v:=.Spec.Labels}}{{$k}} {{$v}}{{"\n"}}{{end}}' |
|
||||||
|
while read label port; do
|
||||||
|
[[ -z "$label" ]] && continue
|
||||||
|
name="${label#ufw.public.}"
|
||||||
|
echo "${name}=$port"
|
||||||
|
done
|
||||||
sleep 60; exit 1
|
sleep 60; exit 1
|
||||||
;;
|
;;
|
||||||
delete|allow)
|
delete|allow)
|
||||||
|
Loading…
Reference in New Issue
Block a user