From 2358b986a80216cf3a54e37184133d459fc8c883 Mon Sep 17 00:00:00 2001 From: SDGDen Date: Mon, 9 Mar 2026 10:11:49 +0100 Subject: [PATCH] made fix to DNS checking script so it no longer crashes. --- deploy.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deploy.sh b/deploy.sh index db19388..881faad 100644 --- a/deploy.sh +++ b/deploy.sh @@ -224,7 +224,7 @@ if [ "$external_access_method" -eq 1 ]; then # Check A record echo -e "${cyan}Checking A record for @...${nc}" - a_record_check=$(dig +short A "$domain" @8.8.8.8 | grep -c "^$publicip$") + a_record_check=$(dig +short A "$domain" @8.8.8.8 2>/dev/null | grep -c "^$publicip$" || echo "0") if [ "$a_record_check" -eq 0 ]; then echo -e "${cyan}⚠️ Warning: A record for @ is not set or not pointing to $publicip${nc}" else @@ -233,12 +233,13 @@ if [ "$external_access_method" -eq 1 ]; then # Check CNAME record echo -e "${cyan}Checking CNAME record for *...${nc}" - cname_record_check=$(dig +short CNAME "*.$domain" @8.8.8.8 | grep -c "$domain\.$") + cname_record_check=$(dig +short CNAME "*.$domain" @8.8.8.8 2>/dev/null | grep -c "$domain\.$" || echo "0") if [ "$cname_record_check" -eq 0 ]; then echo -e "${cyan}⚠️ Warning: CNAME record for * is not set or not pointing to @${nc}" else echo -e "${cyan}✅ CNAME record for * is correctly set to @${nc}" fi + echo "--------------------------------------------------------" echo -e "please double-check your ${cyan}DNS records${nc} to ensure they are set. the following dns records need to be set:" echo "" @@ -248,7 +249,6 @@ if [ "$external_access_method" -eq 1 ]; then echo "" echo -e "once you've done this, press any key to ${underline}continue${nc}" pause_if_enabled - fi # Ask about static public IP if using public DNS if [ "$external_access_method" -eq 1 ]; then