From 3ab6850a07c7086e317b8354f150cb9fa40eefaf Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sat, 15 Jul 2023 12:26:16 -0500 Subject: [PATCH] update --- defaults.inc | 2 +- nodemgmt-scripts.sh | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/defaults.inc b/defaults.inc index dfd573a5..954d34cd 100755 --- a/defaults.inc +++ b/defaults.inc @@ -1,5 +1,5 @@ -VERS='4.9.7-07062023' +VERS='4.9.8-07062023' noheader=' service status-check nightlyrephp7.3-fpm,new backup report check checkcerts gitea update-nodes copynpmcerts singleservercheck update-dyndns ' CERT_DAEMON='/snap/bin/certbot' diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index 27c4a40f..2fc4e3eb 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -532,7 +532,14 @@ UPDATE_DYNDNS(){ elif [ "${1}" == "offsite" ]; then /usr/bin/curl -s "https://systems:Dcs9613@wdns.scity.us/nic/update?hostname=offsite.scity.us&myip=${NEWIP}" > /dev/null 2>&1 - + /usr/bin/curl -s "https://systems:Dcs9613@wdns.scity.us/nic/update?hostname=backup.scity.us&myip=${NEWIP}" > /dev/null 2>&1 + + L_OLDIP=`dig +short offsite.scity.us @10.10.10.5 +time=2` + if ([ "${L_OLDIP}" != "" ] && [[ "${L_OLDIP}" != *";"* ]] && [ "${L_OLDIP}" != "${NEWIP}" ]) || [ "${2}" == "force" ]; then + /usr/bin/curl -s "https://systems:Dcs9613@dns.scity.us/nic/update?hostname=offsite.scity.us&myip=${NEWIP}" > /dev/null 2>&1 + /usr/bin/curl -s "https://systems:Dcs9613@dns.scity.us/nic/update?hostname=backup.scity.us&myip=${NEWIP}" > /dev/null 2>&1 + fi + fi SENDNOTICE "${1^^} DYNDNS Updated" "Updated ${1^} WAN IP from '${OLDIP}' to '${NEWIP}'" [ "${2}" != 'q' ] && echo -e "${idsCL[Green]}done${idsCL[Default]}"