From 1576383e9247bb5fcb4d006c1ccc5022a98cdf43 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Mon, 4 Jul 2022 15:00:31 -0500 Subject: [PATCH] Update nodemgmt-scripts.sh --- nodemgmt-scripts.sh | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index bf908edd..ba8c91e6 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -1737,19 +1737,22 @@ UPDATE_DYNDNS(){ echo -en "${idsCL[LightCyan]}Updating Primary DNS A records with any WAN IP changes... ${idsCL[Default]}" fi + OLDIP=`dig +short sc2.scity.us @ns1.scity.us` NEWIP=`dig +short myip.opendns.com @resolver1.opendns.com` - /usr/bin/curl -s "https://systems:Dcs9613@pdns.scity.us/nic/update?hostname=sc1.scity.us&myip=${NEWIP}" > /dev/null 2>&1 - /usr/bin/curl -s "https://systems:Dcs9613@pdns.scity.us/nic/update?hostname=scity.us&myip=${NEWIP}" > /dev/null 2>&1 - /usr/bin/curl -s "https://systems:Dcs9613@pdns.scity.us/nic/update?hostname=sc2.scity.us&myip=${NEWIP}" > /dev/null 2>&1 - /usr/bin/curl -s "https://systems:Dcs9613@pdns.scity.us/nic/update?hostname=scity.xyz&myip=${NEWIP}" > /dev/null 2>&1 - /usr/bin/curl -s "https://systems:Dcs9613@pdns.scity.us/nic/update?hostname=schroedercity.com&myip=${NEWIP}" > /dev/null 2>&1 - /usr/bin/curl -s "https://systems:Dcs9613@pdns.scity.us/nic/update?hostname=cloud.schroedercity.com&myip=${NEWIP}" > /dev/null 2>&1 - /usr/bin/curl -s "https://systems:Dcs9613@pdns.scity.us/nic/update?hostname=dasrei.com&myip=${NEWIP}" > /dev/null 2>&1 - /usr/bin/curl -s "https://systems:Dcs9613@pdns.scity.us/nic/update?hostname=snsinvest.com&myip=${NEWIP}" > /dev/null 2>&1 - /usr/bin/curl -s "https://systems:Dcs9613@pdns.scity.us/nic/update?hostname=misfitsmc.com&myip=${NEWIP}" > /dev/null 2>&1 + if [ "${OLDIP}" != "${NEWIP}" ]; then + /usr/bin/curl -s "https://systems:Dcs9613@pdns.scity.us/nic/update?hostname=sc1.scity.us&myip=${NEWIP}" > /dev/null 2>&1 + /usr/bin/curl -s "https://systems:Dcs9613@pdns.scity.us/nic/update?hostname=scity.us&myip=${NEWIP}" > /dev/null 2>&1 + /usr/bin/curl -s "https://systems:Dcs9613@pdns.scity.us/nic/update?hostname=sc2.scity.us&myip=${NEWIP}" > /dev/null 2>&1 + /usr/bin/curl -s "https://systems:Dcs9613@pdns.scity.us/nic/update?hostname=scity.xyz&myip=${NEWIP}" > /dev/null 2>&1 + /usr/bin/curl -s "https://systems:Dcs9613@pdns.scity.us/nic/update?hostname=schroedercity.com&myip=${NEWIP}" > /dev/null 2>&1 + /usr/bin/curl -s "https://systems:Dcs9613@pdns.scity.us/nic/update?hostname=cloud.schroedercity.com&myip=${NEWIP}" > /dev/null 2>&1 + /usr/bin/curl -s "https://systems:Dcs9613@pdns.scity.us/nic/update?hostname=dasrei.com&myip=${NEWIP}" > /dev/null 2>&1 + /usr/bin/curl -s "https://systems:Dcs9613@pdns.scity.us/nic/update?hostname=snsinvest.com&myip=${NEWIP}" > /dev/null 2>&1 + /usr/bin/curl -s "https://systems:Dcs9613@pdns.scity.us/nic/update?hostname=misfitsmc.com&myip=${NEWIP}" > /dev/null 2>&1 - echo "DYNDNS Updated" | mail -s "`hostname` (`hostname -I`) sent update" 9208839613@mms.att.net + echo "DYNDNS Updated" | mail -s "`hostname` (`hostname -I`) sent update" 9208839613@mms.att.net + fi if [ "${1}" != 'q' ]; then echo -e "${idsCL[Green]}Done${idsCL[Default]}"