check for subdomain directly in the script

Signed-off-by: Daniel Hansson <mailto@danielhansson.nu>
This commit is contained in:
Daniel Hansson 2022-12-28 11:15:26 +01:00 committed by GitHub
parent ab123163e1
commit a87cf8be11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,13 +29,16 @@ fi
while :
do
# Ask for subdomain
SUBDOMAIN=$(input_box_flow "Please enter the subdomain you want to add or delete, e.g: yoursubdomain")
# Check if subdomain contains a dot
if echo "$SUBDOMAIN" | grep '\.' >/dev/null 2>&1
if [ -z $SUBDOMAIN ]
then
msg_box "Please *only* enter the subomain name like 'yoursubdomain', not 'yoursubdomain.yourdomain.io'."
else
break
SUBDOMAIN=$(input_box_flow "Please enter the subdomain you want to add or delete, e.g: yoursubdomain")
# Check if subdomain contains a dot
if echo "$SUBDOMAIN" | grep '\.' >/dev/null 2>&1
then
msg_box "Please *only* enter the subomain name like 'yoursubdomain', not 'yoursubdomain.yourdomain.io'."
else
break
fi
fi
done