diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index f51778ee..cfe07f7b 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -525,17 +525,6 @@ UPDATE_DYNDNS(){ if ([ "${OLDIP}" != "" ] && [ "${NEWIP}" != "" ] && [[ "${OLDIP}" != *";"* ]] && [[ "${NEWIP}" != *";"* ]]) && ([ "${OLDIP}" != "${NEWIP}" ] || [ ${FORCE} -eq 1 ]); then if [ ${TESTMODE} -eq 1 ]; then echo -e "${idsCL[Green]}'${idsCL[LightCyan]}${LOCATION^^}${idsCL[Green]}' WAN IP has changed: ${idsCL[Yellow]}testmode active and will not update records${idsCL[Default]}" - echo -en "\nDYNDNS Credential Test: " - if [ "$(curl -sL "https://${NM_DYNUSER}df:${NM_DYNPASS}@wdns.scity.us/domain/scity.us" | grep "HTTP 403 Error")" == "" ]; then - echo -e "${idsCL[Green]}Pass${idsCL[Default]}" - else - echo -e "${idsCL[LightRed]}Fail${idsCL[Default]}" - fi - if [ "$(/usr/bin/curl -s "https://${NM_DYNUSER}:${NM_DYNPASS}@wdns.scity.us/nic/update?hostname=wan.pattonfam.com")" == "good" ]; then - echo -e "${idsCL[Green]}Pass${idsCL[Default]}" - else - echo -e "${idsCL[LightRed]}Fail${idsCL[Default]}" - fi else if [ ${FORCE} -eq 1 ]; then echo -en "${idsCL[Yellow]}'${idsCL[LightCyan]}${LOCATION^^}${idsCL[Yellow]}' WAN IP has not changed...\n${idsCL[Green]}but what the heck, lets update the records anyway ehh ... " @@ -593,6 +582,15 @@ UPDATE_DYNDNS(){ else echo -e "${idsCL[Yellow]}'${idsCL[Green]}${LOCATION^^}${idsCL[Yellow]}' WAN IP has not changed${idsCL[Default]}" fi + if [ ${TESTMODE} -eq 1 ]; then + echo -en "\nDYNDNS Credential Test: " + if [ "$(curl -sL "https://${NM_DYNUSER}df:${NM_DYNPASS}@wdns.scity.us/domain/${domain}" | grep "HTTP 403 Error")" == "" ]; then + echo -e "${idsCL[Green]}Pass${idsCL[Default]}" + else + echo -e "${idsCL[LightRed]}Fail${idsCL[Default]}" + fi + fi + else [ "${LOCATION}" == "" ] && echo -e "\n${idsCL[LightYellow]}No DYNDNS location specified" || echo -e "\n${idsCL[Red]}DYNDNS location '${LOCATION}' not recognized" fi