valid port syntax in service allow
This commit is contained in:
parent
b557b56a03
commit
a91e864cfe
@ -124,6 +124,12 @@ function ufw-docker--service-allow() {
|
||||
service_name="$1"
|
||||
service_port="$2"
|
||||
|
||||
if [[ -n "$service_port" ]] &&
|
||||
! grep -E '^[0-9]+(/(tcp|udp))?$' <<< "$service_port" &>/dev/null; then
|
||||
die "Invalid port syntax: $service_port"
|
||||
return 1
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
function ufw-docker--install() {
|
||||
|
Loading…
Reference in New Issue
Block a user