Fix (almost) always truthy regexp in ufw-docker--list

This commit is contained in:
Radosław Kłos 2022-08-22 11:00:10 +02:00 committed by Chai Feng
parent e99858510d
commit a689c4eb6e

View File

@ -42,7 +42,9 @@ function ufw-docker--list() {
NETWORK="[[:graph:]]*"
fi
ufw status numbered | grep "# allow ${INSTANCE_NAME}\\( ${INSTANCE_PORT}\\/${PROTO}\\)\\?\\( ${NETWORK}\\)\\?\$"
ufw status numbered | grep "# allow ${INSTANCE_NAME}\\( ${INSTANCE_PORT}\\/${PROTO}\\)\\( ${NETWORK}\\)\$" || \
ufw status numbered | grep "# allow ${INSTANCE_NAME}\\( ${INSTANCE_PORT}\\/${PROTO}\\)\$" || \
ufw status numbered | grep "# allow ${INSTANCE_NAME}\$"
}
function ufw-docker--list-number() {