From 8c4c8be663f2a699e18dc55085cc3fbdaf898286 Mon Sep 17 00:00:00 2001 From: Navid <51497406+Navid200@users.noreply.github.com> Date: Tue, 29 Nov 2022 19:20:05 -0500 Subject: [PATCH] Update ConfigureFreedns.sh Capital letters in the FreeDNS user ID dialog --- ConfigureFreedns.sh | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/ConfigureFreedns.sh b/ConfigureFreedns.sh index 25000998b00..60d73a1144e 100755 --- a/ConfigureFreedns.sh +++ b/ConfigureFreedns.sh @@ -32,6 +32,17 @@ exec 3>&- user=$(echo "$Values" | sed -n 1p) pass=$(echo "$Values" | sed -n 2p) +if [[ "$user" =~ [A-Z] ]] +then +dialog --colors --msgbox " \Zr Developed by the xDrip team \Zn\n\n\ +Your FreeDNS user ID does not contain uppercase letters. Even though FreeDNS does not inform you, it converts all uppercase letters to lowercase in your user ID.\n\n\ +If you log into FreeDNS and go to the main menu, you can see your approved user ID at the top in the right pane.\n\n\ +Please try again." 16 50 +go_back=1 +fi + +if [ $go_back -lt 1 ] # if 8 +then if [ "$user" = "" ] || [ "$pass" = "" ] # At least one parameter is blank. then go_back=1 @@ -50,8 +61,7 @@ then wget -O /tmp/hosts "$arg" if [ ! "`grep 'Could not authenticate' /tmp/hosts`" = "" ] # Failed to log in then - dialog --colors --msgbox " \Zr Developed by the xDrip team \Zn\n\n\n\ - Failed to authenticate. Try again." 8 50 + dialog --colors --msgbox " \Zr Developed by the xDrip team \Zn\n\n\nFailed to authenticate. Try again." 8 50 go_back=1 fi @@ -60,17 +70,14 @@ then Lines=$(awk 'END{print NR}' /tmp/hosts) if [ $Lines -eq 0 ] # No hostnames # if 5 then - dialog --colors --msgbox " \Zr Developed by the xDrip team \Zn\n\n\ - No subdomains found. Ensure you have one in your Free DNS account, and try again." 9 50 + dialog --colors --msgbox " \Zr Developed by the xDrip team \Zn\n\nNo subdomains found. Ensure you have one in your Free DNS account, and try again." 9 50 go_back=1 elif [ $Lines -gt 1 ] # More than one hostname then clear exec 3>&1 - subvalue=$(dialog --colors --ok-label "Submit" --form " \Zr Developed by the xDrip team \Zn\n\n\n\ - You have more than one subdomain. Enter the subdomain you want to use. \n\ - It should look like mine.strangled.net" 12 50 0 "Subdomain:" 1 1 "$subd" 1 14 25 0 2>&1 1>&3) + subvalue=$(dialog --colors --ok-label "Submit" --form " \Zr Developed by the xDrip team \Zn\n\n\nYou have more than one subdomain. Enter the subdomain you want to use. \nIt should look like mine.strangled.net" 12 50 0 "Subdomain:" 1 1 "$subd" 1 14 25 0 2>&1 1>&3) response2=$? if [ $response2 = 255 ] || [ $response2 = 1 ] # canceled or escaped then @@ -85,8 +92,7 @@ then then go_back=1 clear - dialog --colors --msgbox " \Zr Developed by the xDrip team \Zn\n\n\n\ - You need to enter a subdomain. Try again." 8 50 + dialog --colors --msgbox " \Zr Developed by the xDrip team \Zn\n\n\nYou need to enter a subdomain. Try again." 8 50 fi if [ $go_back -lt 1 ] # if 3 @@ -95,8 +101,7 @@ then if [ ! -s /tmp/FullLine ] # Not found then go_back=1 - dialog --colors --msgbox " \Zr Developed by the xDrip team \Zn\n\n\n\ - The subdomain you entered is not one of the ones we found. Try again." 9 50 + dialog --colors --msgbox " \Zr Developed by the xDrip team \Zn\n\n\nThe subdomain you entered is not one of the ones we found. Try again." 9 50 fi if [ $go_back -lt 1 ] # if 2 then @@ -104,8 +109,7 @@ then if [ $Lines2 -gt 1 ] # More than one found if 1 then go_back=1 - dialog --colors --msgbox " \Zr Developed by the xDrip team \Zn\n\n\n\ - The value you entered matches more than one of your subdomains. Try again and enter a unique value." 11 50 + dialog --colors --msgbox " \Zr Developed by the xDrip team \Zn\n\n\nThe value you entered matches more than one of your subdomains. Try again and enter a unique value." 11 50 else FLine=$( /tmp/FreeDNS_Failed << EOF Internal error. Must run FreeDNS again. EOF -dialog --colors --msgbox " \Zr Developed by the xDrip team \Zn\n\nInternal error. Press enter to exit. Then, run FreeDNS Setup again" 9 50 \ No newline at end of file +dialog --colors --msgbox " \Zr Developed by the xDrip team \Zn\n\nInternal error. Press enter to exit. Then, run FreeDNS Setup again" 9 50 +