mirror of
https://github.com/chaifeng/ufw-docker.git
synced 2025-05-10 13:38:32 +02:00
valid port syntax in service allow
This commit is contained in:
parent
b557b56a03
commit
a91e864cfe
1 changed files with 6 additions and 0 deletions
|
@ -124,6 +124,12 @@ function ufw-docker--service-allow() {
|
||||||
service_name="$1"
|
service_name="$1"
|
||||||
service_port="$2"
|
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() {
|
function ufw-docker--install() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue