🐛 fix regex precedence (fix #1)
All checks were successful
Release / Build and publish Docker images (push) Successful in 1m8s
Release / Create Gitea release (push) Successful in 6s

This commit is contained in:
DrMaxNix 2024-08-27 22:39:12 +02:00
parent 061225e9e3
commit c794049d19

View File

@ -96,14 +96,14 @@ clientmgmt_add(){
# ask whether auto-detection should be used
local answer="x"
local first=0
until [[ -z "$answer" || "$answer" =~ ^Y|y|N|n$ ]]; do
until [[ -z "$answer" || "$answer" =~ ^(Y|y|N|n)$ ]]; do
[[ "$first" -le 0 ]] && first=1 || echo "Invalid answer '$answer'"
read -ep "Auto-detect public IP-Address using icanhazip.com? [Y/n]: " answer
done
# maybe do auto-detection
local public_ip=""
if [[ ! "$answer" =~ ^N|n$ ]]; then
if [[ ! "$answer" =~ ^(N|n)$ ]]; then
local exit=0
local icanhazip
icanhazip=$(wget -O - -q icanhazip.com) || exit=$?
@ -307,7 +307,7 @@ clientmgmt_askname(){
## VALIDATE ##
# check for reserved names
if [[ "$answer" =~ ^ca|server$ ]]; then
if [[ "$answer" =~ ^(ca|server)$ ]]; then
log_error "Name is reserved for internal use: '$answer'"
fi