From 0cfe059547b3717d4b6297e6a74a87a1f05d5e55 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Tue, 14 Nov 2023 16:39:37 -0600 Subject: [PATCH] Update nodemgmt-scripts.sh --- nodemgmt-scripts.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index d9d56ce0..f751a9ea 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -517,7 +517,7 @@ UPDATE_DYNDNS(){ esac shift done - if [ "${LOCATION}" == "mainsite" ] || [ "${LOCATION}" == "offsite" ] || [ "${LOCATION}" == "kyle" ]; then + if [ "${LOCATION,,}" == "mainsite" ] || [ "${LOCATION,,}" == "offsite" ] || [ "${LOCATION,,}" == "kyle" ]; then echo if [ "${NM_DYNUSER}" == "" ] || [ "${NM_DYNPASS}" == "" ]; then echo "Missing DYNDNS username or password (NM_DYNUSER=${NM_DYNUSER}) (NM_DYNPASS=${NM_DYNPASS})" @@ -529,11 +529,11 @@ UPDATE_DYNDNS(){ echo echo -en "${idsCL[White]}Previous WAN IP : " - if [ "${LOCATION}" == "mainsite" ]; then + if [ "${LOCATION,,}" == "mainsite" ]; then OLDIP=`dig +short sc1.scity.us @wdns.scity.us +time=2` - elif [ "${LOCATION}" == "offsite" ]; then + elif [ "${LOCATION,,}" == "offsite" ]; then OLDIP=`dig +short offsite.scity.us @wdns.scity.us +time=2` - elif [ "${LOCATION}" == "kyle" ]; then + elif [ "${LOCATION,,}" == "kyle" ]; then OLDIP=`dig +short wan.pattonfam.com @wdns.scity.us +time=2` fi echo -e "${idsCL[Cyan]}${OLDIP}" @@ -549,9 +549,10 @@ UPDATE_DYNDNS(){ 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 ... " else + SENDNOTICE "${LOCATION^^} WAN IP Changed" "Updated '${LOCATION^}' WAN IP from '${OLDIP}' to '${NEWIP}'" echo -en "${idsCL[Green]}'${idsCL[LightCyan]}${LOCATION^^}${idsCL[Green]}' WAN IP has changed, updating all pre-defined 'A' records ... " fi - if [ "${LOCATION}" == "mainsite" ]; then + 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 /usr/bin/curl -s "https://${NM_DYNUSER}:${NM_DYNPASS}@wdns.scity.us/nic/update?hostname=sc2.scity.us&myip=${NEWIP}" > /dev/null 2>&1 @@ -563,7 +564,7 @@ UPDATE_DYNDNS(){ #internal dns /usr/bin/curl -s "https://${NM_DYNUSER}:${NM_DYNPASS}@dns.scity.us/nic/update?hostname=sc1.scity.us&myip=${NEWIP}" > /dev/null 2>&1 - elif [ "${LOCATION}" == "offsite" ]; then + elif [ "${LOCATION,,}" == "offsite" ]; then #external dns /usr/bin/curl -s "https://${NM_DYNUSER}:${NM_DYNPASS}@wdns.scity.us/nic/update?hostname=offsite.scity.us&myip=${NEWIP}" > /dev/null 2>&1 /usr/bin/curl -s "https://${NM_DYNUSER}:${NM_DYNPASS}@wdns.scity.us/nic/update?hostname=backup.scity.us&myip=${NEWIP}" > /dev/null 2>&1 @@ -571,11 +572,10 @@ UPDATE_DYNDNS(){ /usr/bin/curl -s "https://${NM_DYNUSER}:${NM_DYNPASS}@dns.scity.us/nic/update?hostname=offsite.scity.us&myip=${NEWIP}" > /dev/null 2>&1 /usr/bin/curl -s "https://${NM_DYNUSER}:${NM_DYNPASS}@dns.scity.us/nic/update?hostname=backup.scity.us&myip=${NEWIP}" > /dev/null 2>&1 - elif [ "${LOCATION}" == "kyle" ]; then + elif [ "${LOCATION,,}" == "kyle" ]; then /usr/bin/curl -s "https://${NM_DYNUSER}:${NM_DYNPASS}@wdns.scity.us/nic/update?hostname=wan.pattonfam.com&myip=${NEWIP}" > /dev/null 2>&1 fi - SENDNOTICE "${LOCATION^^} DYNDNS Updated" "Updated ${LOCATION^} WAN IP from '${OLDIP}' to '${NEWIP}'" echo -e "${idsCL[Green]}Done${idsCL[Default]}" fi