Update nodemgmt-scripts.sh

This commit is contained in:
2023-11-15 08:23:00 -06:00
parent 96f7223aec
commit f5a6104970

View File

@@ -512,29 +512,14 @@ UPDATE_DYNDNS(){
for host in "${hosts[@]}"; do
arr_insert DYNDNS_HOSTS ${host}
done
echo "HERE1: ${DYNDNS_HOSTS[0]}"
for test in ${DYNDNS_HOSTS[@]}; do
echo "HERE2: $test"
done
domain=${DYNDNS_HOSTS[0]#*.}
echo "${DYNDNS_HOSTS[0]} = ${domain}"
echo
cw_spc=10
echo -e "Checking for DYNDNS update at '${idsCL[Green]}${LOCATION^^}${idsCL[Default]}'"
echo
echo -en "${idsCL[White]}Previous WAN IP : "
if [ "${LOCATION,,}" == "mainsite" ]; then
OLDIP=`dig +short sc1.scity.us @wdns.scity.us +time=2`
elif [ "${LOCATION,,}" == "offsite" ]; then
OLDIP=`dig +short offsite.scity.us @wdns.scity.us +time=2`
elif [ "${LOCATION,,}" == "kyle" ]; then
OLDIP=`dig +short wan.pattonfam.com @wdns.scity.us +time=2`
fi
echo -e "${idsCL[Cyan]}${OLDIP}"
echo -en "${idsCL[White]}Current WAN IP : "
NEWIP=`dig +short myip.opendns.com @resolver1.opendns.com +time=2`
echo -e "${idsCL[LightGreen]}${NEWIP}"
echo -en "${idsCL[White]}Previous WAN IP : "; OLDIP=`dig +short ${DYNDNS_HOSTS[0]} @wdns.scity.us +time=2`; echo -e "${idsCL[Cyan]}${OLDIP}"
echo -en "${idsCL[White]}Current WAN IP : "; NEWIP=`dig +short myip.opendns.com @resolver1.opendns.com +time=2`; echo -e "${idsCL[LightGreen]}${NEWIP}"
echo
if ([ "${OLDIP}" != "" ] && [ "${NEWIP}" != "" ] && [[ "${OLDIP}" != *";"* ]] && [[ "${NEWIP}" != *";"* ]]) && ([ "${OLDIP}" != "${NEWIP}" ] || [ ${FORCE} -eq 1 ]); then