diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index 2a518d87..e04c426a 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -542,12 +542,15 @@ UPDATE_DYNDNS(){ echo -e "${idsCL[Green]}${NEWIP}" echo - if ([ "${OLDIP}" != "" ] && [ "${NEWIP}" != "" ] && [[ "${OLDIP}" != *";"* ]] && [[ "${NEWIP}" != *";"* ]] && [ "${OLDIP}" != "${NEWIP}" ]) || [ ${FORCE} -eq 1 ]; then - echo -en "${idsCL[Green]}'${idsCL[LightCyan]}${LOCATION^^}${idsCL[Green]}' WAN IP has changed, "; + if ([ "${OLDIP}" != "" ] && [ "${NEWIP}" != "" ] && [[ "${OLDIP}" != *";"* ]] && [[ "${NEWIP}" != *";"* ]]) && ([ "${OLDIP}" != "${NEWIP}" ] || [ ${FORCE} -eq 1 ]); then if [ ${TESTMODE} -eq 1 ]; then - echo -e "${idsCL[Yellow]}testmode active and will not update rcords${idsCL[Default]}" + echo -e "${idsCL[Green]}'${idsCL[LightCyan]}${LOCATION^^}${idsCL[Green]}' WAN IP has changed: ${idsCL[Yellow]}testmode active and will not update records${idsCL[Default]}" else - echo -en ", updating records ... " + if [ ${FORCE} -eq 1 ]; then + echo -en "${idsCL[Green]}'${idsCL[LightCyan]}${LOCATION^^}${idsCL[Green]}' WAN IP has not changed... but what the heck, lets update the records anyway ehh ... " + else + echo -en "${idsCL[Green]}'${idsCL[LightCyan]}${LOCATION^^}${idsCL[Green]}' WAN IP has changed, updating all pre-defined 'A' records ... " + fi if [ "${LOCATION}" == "mainsite" ]; then #external dns /usr/bin/curl -s "https://${NM_DYNUSER}:${NM_DYNPASS}@wdns.scity.us/nic/update?hostname=sc1.scity.us&myip=${NEWIP}" > /dev/null 2>&1