From bbb6fa03baa707315b57d9cbf31f285f8f6b9678 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Wed, 15 Nov 2023 08:11:09 -0600 Subject: [PATCH] update --- defaults.inc | 3 ++- nodemgmt-scripts.sh | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/defaults.inc b/defaults.inc index a1fcb0e9..1811680e 100755 --- a/defaults.inc +++ b/defaults.inc @@ -1,5 +1,5 @@ #!/usr/bin/env bash -VERS='4.14.10-11142023' +VERS='4.14.11-11142023' noheader=' service status-check nightlyrephp7.3-fpm,new backup report check checkcerts gitea update-nodes copynpmcerts singleservercheck update-dyndns backup-offsitepfsense gui nightlyreview update ' CERT_DAEMON='/snap/bin/certbot' @@ -26,6 +26,7 @@ if [ -f ${NM_FOLDER}/conf/defaults.local.inc ]; then declare -A NM_SINGLESRVR_IP declare -A NM_CERTPATHS declare -A NM_WWWPATHS + declare -A NM_DYNDNS_LOC source ${NM_FOLDER}/conf/defaults.local.inc diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index 97aab582..d15ee3a1 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -506,7 +506,7 @@ UPDATE_DYNDNS(){ esac shift done - if [ "${LOCATION,,}" == "mainsite" ] || [ "${LOCATION,,}" == "offsite" ] || [ "${LOCATION,,}" == "kyle" ]; then + if [ "${NM_DYNDNS_LOC}" != "" ] && [ "${NM_DYNDNS_LOC[${LOCATION,,}]}" != "" ]; then echo cw_spc=10 echo -e "Checking for DYNDNS update at '${idsCL[Green]}${LOCATION^^}${idsCL[Default]}'" @@ -530,7 +530,7 @@ UPDATE_DYNDNS(){ 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 [ "$(/usr/bin/curl -s "https://${NM_DYNUSER}:${NM_DYNPASS}@wdns.scity.us/nic/update?hostname=sc1.scity.us")" == "good" ]; then + 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]}"