From a87cf8be11965fa4e6e78e388cb8fba3cdbc0e9a Mon Sep 17 00:00:00 2001 From: Daniel Hansson Date: Wed, 28 Dec 2022 11:15:26 +0100 Subject: [PATCH] check for subdomain directly in the script Signed-off-by: Daniel Hansson --- addons/deSEC/desec_subdomain.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/addons/deSEC/desec_subdomain.sh b/addons/deSEC/desec_subdomain.sh index f6037234..eff1c038 100644 --- a/addons/deSEC/desec_subdomain.sh +++ b/addons/deSEC/desec_subdomain.sh @@ -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