if no port number

This commit is contained in:
Chai Feng 2018-10-03 10:34:11 +08:00
parent 6001834bab
commit e0b4536873
No known key found for this signature in database
GPG Key ID: 2DCD9A24E523FFD2

View File

@ -134,6 +134,7 @@ function ufw-docker--service-allow() {
declare port="${service_port%/*}" declare port="${service_port%/*}"
declare proto="(tcp|udp)" declare proto="(tcp|udp)"
[[ -z "$port" ]] && port="[0-9]+"
[[ "$service_port" = */* ]] && proto="${service_port#*/}" [[ "$service_port" = */* ]] && proto="${service_port#*/}"
if ! docker service inspect "$service_name" \ if ! docker service inspect "$service_name" \