From b4e1ebbd70beebdd2e09fd432fb15b2c26383cde Mon Sep 17 00:00:00 2001 From: SDGDen Date: Mon, 9 Mar 2026 09:22:23 +0100 Subject: [PATCH] fixed DNS selector --- deploy.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/deploy.sh b/deploy.sh index f97b023..f1d13cf 100644 --- a/deploy.sh +++ b/deploy.sh @@ -183,11 +183,11 @@ echo "" while true; do read -p "Enter your choice (1-3): " external_access_method case "$external_access_method" in - 1|2|3) + (1|2|3) echo "Selected option: $external_access_method" break ;; - *) + (*) echo "Invalid choice. Please enter 1, 2, or 3." ;; esac @@ -217,7 +217,7 @@ fi -if [["$external_access_method" -eq 1]]; then +if ["$external_access_method" -eq 1]; then # Verify DNS records echo -e "${cyan}Verifying DNS records...${nc}" echo "" @@ -225,7 +225,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$") - if [[ "$a_record_check" -eq 0 ]]; then + if [ "$a_record_check" -eq 0 ]; then echo -e "${cyan}⚠️ Warning: A record for @ is not set or not pointing to $publicip${nc}" else echo -e "${cyan}✅ A record for @ is correctly set to $publicip${nc}" @@ -234,7 +234,7 @@ 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\.$") - if [[ "$cname_record_check" -eq 0 ]]; then + 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}" @@ -251,7 +251,7 @@ if [["$external_access_method" -eq 1]]; then fi # Ask about static public IP if using public DNS -if [[ "$external_access_method" -eq 1 ]]; then +if [ "$external_access_method" -eq 1 ]; then while true; do @@ -565,11 +565,11 @@ Add any other subdomains you want to use. EOF # Write PiHole config (only for options 2 and 3) -if [[ "$external_access_method" -eq 2 ]] || [[ "$external_access_method" -eq 3 ]]; then +if [ "$external_access_method" -eq 2 ] || [ "$external_access_method" -eq 3 ]; then echo "Writing PiHole configuration..." # Use public IP for option 3, local IP for option 2 - if [[ "$external_access_method" -eq 3 ]]; then + if [ "$external_access_method" -eq 3 ]; then dns_ip="$publicip" else dns_ip="$localip" @@ -584,7 +584,7 @@ EOF docker restart pihole fi # Enable DHCP on PiHole for options 2 and 3 -if [[ "$external_access_method" -eq 2 ]] || [ "$external_access_method" -eq 3 ]; then +if [ "$external_access_method" -eq 2 ] || [ "$external_access_method" -eq 3 ]; then echo "Configuring DHCP on PiHole..." # Get network information