🐛 fix regex precedence (fix #1)
This commit is contained in:
parent
061225e9e3
commit
c794049d19
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user